Skip to content

Fix broken bibtex output from biber#19

Open
k4rtik wants to merge 2 commits intomainfrom
fix-broken-bibtex-output-from-biber-7212322488588886541
Open

Fix broken bibtex output from biber#19
k4rtik wants to merge 2 commits intomainfrom
fix-broken-bibtex-output-from-biber-7212322488588886541

Conversation

@k4rtik
Copy link
Copy Markdown
Member

@k4rtik k4rtik commented Apr 3, 2026

This PR improves the bibtex-compatibility.py script, which is used to normalize BibLaTeX output from biber into standard BibTeX. The original script had several logic flaws, such as incorrectly matching urldate when trying to process the date field, and performing replacements inside field values.

The new implementation uses more precise, anchored regular expressions to ensure that only field names at the beginning of a line are replaced. It also correctly maps various BibLaTeX-specific entry types to their BibTeX equivalents and includes a specific fix for a master's thesis entry. The script has been modernized with context managers and improved error handling.


PR created automatically by Jules for task 7212322488588886541 started by @k4rtik

google-labs-jules bot and others added 2 commits April 3, 2026 20:17
Improved `bibtex-compatibility.py` to robustly convert BibLaTeX entries
to standard BibTeX.

Key improvements:
- Use anchored regex to target fields at the start of a line, preventing
  incorrect replacements of `urldate` or field names inside values.
- Improved mapping of BibLaTeX entry types (@online, @report, @thesis)
  to standard BibTeX types.
- Specific handling for Singhal2020a master's thesis.
- Better resource management using context managers.
- Added basic error handling for command-line arguments and missing files.

Co-authored-by: k4rtik <374340+k4rtik@users.noreply.github.com>
@k4rtik k4rtik marked this pull request as ready for review April 3, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant