citation-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Citation Management

引用管理

Manage the full lifecycle of citations in a LaTeX paper.
管理LaTeX论文中引用的完整生命周期。

Input

输入

  • $0
    — Action:
    harvest
    ,
    validate
    ,
    add
    ,
    format
  • $1
    — Path to
    .tex
    or
    .bib
    file
  • $0
    — 操作:
    harvest
    (获取)、
    validate
    (验证)、
    add
    (添加)、
    format
    (格式化)
  • $1
    — .tex或.bib文件的路径

Scripts

脚本

Validate citations (check all cite keys resolve)

验证引用(检查所有引用键是否可解析)

bash
python ~/.claude/skills/citation-management/scripts/validate_citations.py \
  --tex paper/main.tex --bib paper/references.bib --check-figures --figures-dir paper/figures/
Reports: missing citations, unused bib entries, duplicate keys, duplicate sections, duplicate labels, undefined references, missing figures.
bash
python ~/.claude/skills/citation-management/scripts/validate_citations.py \
  --tex paper/main.tex --bib paper/references.bib --check-figures --figures-dir paper/figures/
报告内容:缺失的引用、未使用的bib条目、重复键、重复章节、重复标签、未定义的引用、缺失的图片。

Generate BibTeX from paper database

从论文数据库生成BibTeX

bash
python ~/.claude/skills/deep-research/scripts/bibtex_manager.py \
  --jsonl paper_db.jsonl --output references.bib
bash
python ~/.claude/skills/deep-research/scripts/bibtex_manager.py \
  --jsonl paper_db.jsonl --output references.bib

Search for a specific paper to add

搜索特定论文以添加引用

bash
python ~/.claude/skills/deep-research/scripts/search_semantic_scholar.py \
  --query "attention is all you need" --max-results 5 \
  --api-key "$(grep S2_API_Key /Users/lingzhi/Code/keys.md 2>/dev/null | cut -d: -f2 | tr -d ' ')"
bash
python ~/.claude/skills/deep-research/scripts/search_semantic_scholar.py \
  --query "attention is all you need" --max-results 5 \
  --api-key "$(grep S2_API_Key /Users/lingzhi/Code/keys.md 2>/dev/null | cut -d: -f2 | tr -d ' ')"

Harvest missing citations automatically

自动获取缺失的引用

bash
python ~/.claude/skills/citation-management/scripts/harvest_citations.py \
  --tex paper/main.tex --bib paper/references.bib --output candidates.bib --max-rounds 10
Scans .tex for uncited claims, searches Semantic Scholar, outputs candidate BibTeX entries. Key flags:
--dry-run
(preview only),
--verbose
,
--api-key
bash
python ~/.claude/skills/citation-management/scripts/harvest_citations.py \
  --tex paper/main.tex --bib paper/references.bib --output candidates.bib --max-rounds 10
扫描.tex文件查找未引用的论点,在Semantic Scholar中进行搜索,输出候选BibTeX条目。 关键参数:
--dry-run
(仅预览)、
--verbose
(详细模式)、
--api-key
(API密钥)

Auto-fix missing citation placeholders

自动修复缺失的引用占位符

bash
python ~/.claude/skills/citation-management/scripts/validate_citations.py \
  --tex paper/main.tex --bib paper/references.bib --fix
Generates
references_fixed.bib
with placeholder entries for all missing citation keys.
bash
python ~/.claude/skills/citation-management/scripts/validate_citations.py \
  --tex paper/main.tex --bib paper/references.bib --fix
生成
references_fixed.bib
文件,为所有缺失的引用键添加占位条目。

Action:
harvest
— Iterative Citation Harvesting

操作:
harvest
— 迭代式引用获取

Based on AI-Scientist's 20-round citation harvesting loop. For each round:
  1. Read the current
    .tex
    draft
  2. Identify the most important missing citation
  3. Search Semantic Scholar via script
  4. Select the most relevant paper from results
  5. Extract BibTeX and generate a clean key (
    lastNameYearWord
    )
  6. Append to
    .bib
    (skip if key exists)
  7. Insert
    \cite{key}
    at the appropriate location
  8. Stop when no more gaps or 20 rounds reached
Key rules:
  • DO NOT add a citation that already exists
  • Only add citations found via API — never fabricate
  • Cite broadly — not just popular papers
  • Do not copy verbatim from prior literature
基于AI-Scientist的20轮引用获取循环。每一轮包括:
  1. 读取当前的.tex草稿
  2. 识别最重要的缺失引用
  3. 通过脚本搜索Semantic Scholar
  4. 从结果中选择最相关的论文
  5. 提取BibTeX并生成清晰的引用键(格式:
    lastNameYearWord
  6. 添加到.bib文件(若键已存在则跳过)
  7. 在合适位置插入
    \cite{key}
  8. 当无更多缺失或达到20轮时停止
核心规则:
  • 请勿添加已存在的引用
  • 仅添加通过API找到的引用——切勿编造
  • 广泛引用——不要只引用热门论文
  • 不要直接复制现有文献的内容

Action:
validate
— Pre-Compilation Check

操作:
validate
— 编译前检查

Run
validate_citations.py
to catch all issues before compilation. Fix any reported problems.
运行
validate_citations.py
以在编译前捕获所有问题。修复所有报告的问题。

Action:
add
— Add Specific Paper

操作:
add
— 添加特定论文

Search Semantic Scholar for the paper, extract BibTeX, clean the key, append to
.bib
.
BibTeX key format:
firstAuthorLastNameYearFirstContentWord
(e.g.,
vaswani2017attention
)
在Semantic Scholar中搜索该论文,提取BibTeX,整理引用键,添加到.bib文件。
BibTeX引用键格式:
firstAuthorLastNameYearFirstContentWord
(例如:
vaswani2017attention

Action:
format
— Standardize .bib

操作:
format
— 标准化.bib文件

  • Sort entries alphabetically by key
  • Ensure consistent indentation (2 spaces)
  • Remove empty fields
  • Protect proper nouns with
    {Braces}
    in titles
  • Ensure required fields per entry type
  • 按引用键字母顺序排序条目
  • 确保一致的缩进(2个空格)
  • 移除空字段
  • 在标题中用
    {Braces}
    保护专有名词
  • 确保每个条目类型包含必填字段

Related Skills

相关技能

  • Upstream: literature-search, deep-research
  • Downstream: paper-compilation, latex-formatting
  • See also: related-work-writing
  • 上游:文献搜索深度研究
  • 下游:论文编译LaTeX格式调整
  • 另见:相关工作撰写