yuchenlin/rebiber · 上手攻略
- 仓库:yuchenlin/rebiber
- 链接:https://github.com/yuchenlin/rebiber
- 分类:academic-writing
- 作者:spark
- 更新:2026-08-19
是什么
rebiber 是 Bill Yuchen Lin(LIN 等 ACL/EMNLP 圈引用率最高的那批作者)开源的 BibTeX 规范化工具:把 .bib 文件里那些"半成品"的 arXiv 预印本、DBLP 残缺记录、ACL Anthology 早期条目,就地替换为官方 DBLP / ACL Anthology 的完整、规范化、可引用的元数据。cite key 保持不变,所以 .tex / .Typst / \.md 里所有 \cite{...} 引用都不需要改。
⚠️ 项目只通过 GitHub 分发,不发布到 PyPI。任何执行
pip install rebiber安装的 2021 1.1.3 旧版都不在官方支持范围。
解决什么问题
学术写作有三条典型痛点:
- arXiv 引用版 vs 正式发表版:写论文时引的是
arXiv preprint arXiv:2005.00683,后来会议出 EMNLP 2020 正式版,作者、期刊、页码、DOI 全不一样——rebiber 一键替换。 - DBLP 残缺字段:很多会议 DBLP 同步不及时,缺 DOI、缺页码、缺
booktitle。rebiber 用仓库内维护的官方 dump 补全。 - cite key 漂移:换工具(BibTeX → Better BibTeX → Zotero → 再导出 BibTeX)会让 cite key 变成
lin2020numerSense→BIB_LIN2020NUM_001——参考资料里所有\cite{}都要改。rebiber 设计上不动 ID,只换条目内容。
快速安装
uv 工具(推荐)
uv tool install git+https://github.com/yuchenlin/rebiber
pip
pip install "rebiber @ git+https://github.com/yuchenlin/rebiber"
源码开发
git clone https://github.com/yuchenlin/rebiber.git && cd rebiber
uv sync --extra dev # 或 pip install -e ".[dev]"
uv run pytest
⚠️ 版本:仓库当前默认分支含最新会议索引(monthly job 自动 dump);PyPI 上的
rebiber 1.1.3(2021)已严重过时。
核心用法
最常用:就地预览变更
rebiber -i refs.bib --dry-run
rebiber -i refs.bib --dry-run --report changes.txt # 同时写报告
写出规范化文件
rebiber -i refs.bib -o refs.official.bib
⚠️ 省略
-o会覆盖每个输入文件。第一次用务必先--dry-run。
只改论文里引用的条目
rebiber -i refs.bib --used-in paper.tex appendix.tex
未 \cite{} 引用的条目仍然会被 prettier 格式化,但不会被数据库替换。
接受本地库的"miss"后,回退到 DBLP 实时检索
rebiber -i refs.bib --live-lookup
DBLP 实时搜索受自家 rate limit 约束(每分钟只有少量请求额度),不要在大文件上使用。
批量处理
rebiber -i *.bib -o ./normalized/
只美化、不替换
rebiber -i refs.bib --format-only -o pretty.bib
保护大小写敏感缩写
rebiber -i refs.bib \
--keep author,title,booktitle,journal,year,volume,number,pages,doi \
--protect-titles
--protect-titles 会把 BERT、GPT-2 这类缩写用 {} 包起来,避免被 BibTeX 渲染成 "Bert" / "Gpt-2"。
关键参数表
| 参数 | 默认 | 含义 |
|---|---|---|
-i |
必填 | 一个或多个 .bib 文件 |
-o |
原位 | 单文件输出;多 -i 时是目录 |
--dry-run |
关 | 只打 changelog,不写文件 |
--report PATH |
— | 同步写 changelog 到文件 |
--used-in TEX … |
全部 key | 只改 \cite{} 引用到的条目 |
--live-lookup |
关 | 本地 miss 后实时走 DBLP 搜索(最多 5 次) |
--keep FIELDS |
全部 | 字段白名单(ID / ENTRYTYPE 永远保留) |
--protect-titles |
关 | 给缩写加 {} 保护 |
--format-only |
关 | 只格式化、不查库 |
--no-check-authors |
关 | 跳过 last-name 一致性检查 |
-r fields |
— | 删掉指定字段,如 -r url,biburl,timestamp |
-s |
False | 用 abbr.tsv 简短化 venue |
-d |
True | 保留重复 cite key |
-st |
True | 按 cite key 排序 |
-l / -a |
内置 | 自定义 bib_list.txt / abbr.tsv |
-u |
— | 从 GitHub main 刷新本地 dump |
-v |
— | 打印版本 |
例子
输入(examples/input.bib):
@article{lin2020birds,
title={Birds have four legs?! NumerSense: Probing Numerical Commonsense Knowledge of Pre-trained Language Models},
author={Lin, Bill Yuchen and Lee, Seyeon and Khanna, Rahul and Ren, Xiang},
journal={arXiv preprint arXiv:2005.00683},
year={2020}
}
输出(examples/output.bib):
@inproceedings{lin2020birds,
title={Birds have four legs?! NumerSense: Probing Numerical Commonsense Knowledge of Pre-trained Language Models},
author={Lin, Bill Yuchen and Lee, Seyeon and Khanna, Rahul and Ren, Xiang},
booktitle={Proceedings of EMNLP},
year={2020},
url={https://aclanthology.org/2020.emnlp-main.515},
doi={10.18653/v1/2020.emnlp-main.515},
pages={...},
publisher={Association for Computational Linguistics}
}
cite key 完全一致,
\cite{lin2020birds}一行不用改。
重建 dump(高级)
下载 DBLP 实时数据:
uv run python -m rebiber.download_dblp --confs iclr --start-year 2026
生成的 JSON 落在 rebiber/data/{conf}{year}.bib.json,会同步追加到 bib_list.txt。
典型适用场景
- 论文投稿前:把
refs.bib全部刷成官方版,避免 reviewer 抓到残缺元数据。 - arXiv 预印本 → 正式发表:换会议/期刊后只改了一遍
refs.bib,正文不用扫。 - 构造个人统一文献库:把 BibTeX、Zotero、
betterbib导出混在一起都用 rebiber 规范化。 - 教学/讲座准备:把学生引用的旧版
bib快速对齐到 mainstream 引用风格。
坑与注意
- 作者匹配规则严谨:
- 标题匹配时第一作者 last name 必须相同;或至少 2 个 last name 重叠。
-
and others/et al./et.al.会被剥掉;空作者列表永远不匹配(即使--no-check-authors也一样)。 - 数字保留:标题做匹配时先做"数字保留"key(如
16x16 ≠ 32x32),再做"仅字母"key。 - 本地 miss 才会
--live-lookup:DBLP 已收录的优先用本地 dump,不会实时查;只有本地确实没有才会去 DBLP 搜。 - DBLP 优先非-arXiv 记录:如果同一篇有 arXiv 又有会议版,replace 用会议版;但会把
eprint字段保留以防万一。 - arXiv 形式:未发表预印本会被改写成
@misc { eprint, archivePrefix, primaryClass };已发表论文即使 abstract 提到 arXiv 也不会被改回。 - 解析失败的条目不会被丢弃:保留原文,方便后续手工修复。
- DBLP rate limit:
--live-lookup每分钟只有少量请求,别对 1000+ 条大文件使用——建议先跑--dump模式。 - 不支持的会议:COLM(DBLP toc 为空)、ICLR/ICML/CVPR 2026、RSS/CoRL 2025、ECCV 2026——尚未进入 DBLP 时序库。
- 历史冻结库 (~2020):ALENEX、ASONAM、BigData、CIDR、CIKM、COLT、MM、RecSys、SDM、SIGMOD(至 2022;后续年份在 PACMMOD)、SODA、STOC、WSDM——这些不再更新。
与同类对比
| 工具 | 数据源 | 改 key | 风格 |
|---|---|---|---|
| rebiber | DBLP + ACL Anthology dump | 不改 | 保持 cite key 只换内容 |
| bibtex-tidy | — | 重写 | 排版整理 |
| orcid-to-bibtex | ORCID | 改 | 拉个人全部论文 |
| doi2bib | Crossref | 改 | 单条 |
| Zotero + Better BibTeX | Zotero DB | 保持 | 图形化 |
→ 规范化大文件 + 保持 cite key 不变:rebiber 几乎没对手;纯排版:bibtex-tidy;GUI/长期库:Zotero + Better BibTeX。
一句话推荐结论
论文投稿前必跑一次
rebiber -i refs.bib --dry-run——既能看到命中了多少官方版,也能避免 reviewer 抓到arXiv preprint残缺引用;近 5 年做 NLP / ML / CV 方向的研究者/学生都该把这套放进工作流。