Skip to content

bibtex.py: Allow generating macros (for month field)

Hélène Jonin requested to merge hjonin/swh-indexer:handle-bibtex-macro into master

As seen in a discussion with Roberto, Morane and Valentin, month field should be a macro (representing a 3 letters month literal) for backward compatibility. I am making this proposal to allow generating a macro using pybtex, which does not handle it natively.

By default, the pybtex BibTeX writer quotes every field value. I am creating a new plugin, pybtex.database.output.BibTeXWithMacroWriter, that I register dynamically with register_plugin(). This plugin overrides the BibTeX writer quote() method to prevent from quoting fields starting with macro:. This syntax can be discussed.

Resolves #4741 (closed).

Merge request reports