Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert parsed bibtex to plaintext #433

Open
prady0t opened this issue Jan 17, 2024 · 1 comment
Open

Convert parsed bibtex to plaintext #433

prady0t opened this issue Jan 17, 2024 · 1 comment

Comments

@prady0t
Copy link

prady0t commented Jan 17, 2024

I'm currently working on a project that used pybtex for parsing bibtex file, but we want to switch to bibtexparser. Pybtex has a plugin to convert to plaintext (UTF-8). Example :

@article{Chen2020,
  author = {Chen, Chang-Hui and Brosa Planella, Ferran and O'Regan, Kieran and Gastol, Dominika and Widanage, W. Dhammika and Kendrick, Emma},
  title = {{Development of Experimental Techniques for Parameterization of Multi-scale Lithium-ion Battery Models}},
  journal = {Journal of The Electrochemical Society},
  volume = {167},
  number = {8},
  pages = {080534},
  year = {2020},
  publisher = {The Electrochemical Society},
  doi = {10.1149/1945-7111/ab9050},
}

gets converted to UTF-8 plaintext as:

Chang-Hui Chen, Ferran Brosa Planella, Kieran O’Regan, Dominika Gastol, W. Dhammika Widanage, and Emma Kendrick. "Development of Experimental Techniques for Parameterization of Multi-scale Lithium-ion Battery Models." Journal of the Electrochemical Society 167 (2020): 080534.

Since direct conversion is not possible in bibtexparser what measures can be taken to convert the parsed string to plaintext whose output remains as close to above as possible?

I would like to always print author, title etc in a specific order and independent of how it's written in .bib file itself.

@MiWeiss MiWeiss changed the title Question : Is there a way to convert parsed bibtex to UTF-8 text? Question : Is there a way to convert parsed bibtex to plaintext? Jan 18, 2024
@MiWeiss
Copy link
Collaborator

MiWeiss commented Jan 18, 2024

Hi @prady0t

Thanks a lot for your question. At the moment, a conversion to another representation is not supported.

I believe that especially your usecase is frequent enough to add it to the codebase, even if it's not really part of the core functionality of a bibtexparser.

I won't be able to implement this anytime soon though. If you'd be willing to open a PR with a well-tested version of such an exporter I'd be happy to review it though.

@MiWeiss MiWeiss changed the title Question : Is there a way to convert parsed bibtex to plaintext? Convert parsed bibtex to plaintext? Jan 18, 2024
@MiWeiss MiWeiss changed the title Convert parsed bibtex to plaintext? Convert parsed bibtex to plaintext Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants