| name | bibtex-management-guide |
| description | Clean, format, deduplicate, and manage BibTeX bibliography files for LaTeX |
| metadata | {"openclaw":{"emoji":"🗃️","category":"writing","subcategory":"citation","keywords":["BibTeX formatting","BibTeX conversion","bibliography cleanup","reference deduplication","citation management"],"source":"wentor"}} |
BibTeX Management Guide
A skill for maintaining clean, consistent, and complete BibTeX bibliography files. Covers formatting standards, deduplication, common errors, and automated cleanup workflows essential for LaTeX-based academic writing.
BibTeX Entry Standards
Required Fields by Entry Type
% Article in a journal
@article{smith2024deep,
author = {Smith, John A. and Doe, Jane B.},
title = {Deep Learning for Climate Prediction: A Comparative Study},
journal = {Nature Machine Intelligence},
year = {2024},
volume = {6},
number = {3},
pages = {234--248},
doi = {10.1038/s42256-024-00001-1}
}
% Conference proceedings
@inproceedings{lee2024attention,
author = {Lee, Wei and Chen, Li},
title = {Attention Mechanisms for Scientific Document Understanding},
booktitle = {Proceedings of the 62nd Annual Meeting of the ACL},
year = {2024},
pages = {1123--1135},
publisher = {Association for Computational Linguistics},
doi = {10.18653/v1/2024.acl-main.89}
}
% Book
@book{bishop2006pattern,
author = {Bishop, Christopher M.},
title = {Pattern Recognition and Machine Learning},
publisher = {Springer},
year = {2006},
isbn = {978-0387310732}
}
Automated BibTeX Cleanup
Deduplication
import re
from collections import defaultdict
() -> []:
entries = []
pattern =
matches = re.finditer(pattern, bib_content, re.DOTALL)
matches:
entry = {
: .group().lower(),
: .group().strip(),
: .group(),
: {}
}
fields_str = .group()
field_pattern =
field_match re.finditer(field_pattern, fields_str, re.DOTALL):
entry[][field_match.group().lower()] = field_match.group().strip()
entries.append(entry)
entries
() -> :
seen_dois = {}
seen_titles = {}
duplicates = []
unique = []
entry entries:
doi = entry[].get(, ).lower().strip()
title = entry[].get(, ).lower().strip()
title_normalized = re.sub(, , title)
is_duplicate =
doi doi seen_dois:
duplicates.append({
: entry[],
: seen_dois[doi],
:
})
is_duplicate =
doi:
seen_dois[doi] = entry[]
is_duplicate title_normalized:
title_normalized seen_titles:
duplicates.append({
: entry[],
: seen_titles[title_normalized],
:
})
is_duplicate =
:
seen_titles[title_normalized] = entry[]
is_duplicate:
unique.append(entry)
{
: (unique),
: (duplicates),
: duplicates,
: unique
}