Not really a bug but I don't know where to ask for help!

Issue #107 resolved
Eric Anderson created an issue

Sorry about misusing the bug reporting mechanism, but I feel like this has to have a simple answer and I can't find it so far. I'd also happily settle for being directed to the appropriate mailing list...

I have a BibliographyData object (or, alternately, an Entry object). I want to render it to an HTML snippet (not an entire document). I can't find any appropriate function / method to do this. The closest I've got is this, which is both ugly as sin and doesn't quite produce the desired output:

asdf = pybtex.database.parse_string(...., "bibtex")
eng = pybtex.PybtexEngine()
eng.format_from_string(bib_string=asdf.to_string("bibtex"), style="unsrt", output_backend="html", outpub_encoding="html")

Comments (2)

  1. Andrey Golovizin

    Currently, there is no API to pass a BibliographyData object to PybtexEngine. The reason for that is that 1) .bib files can contain macros, and 2) bibliography styles can define there own macros. The BibTeX parser in Pybtex currently substitutes macros with their string values during parsing. That means that the parsing result may depend on the bibliography style. For that reason, PybtexEngine currently parses the bibliography data itself to be able to apply the correct macros from the bibliography style. I've added two issues for that: #108 and #109.

  2. Log in to comment