GetRD / academic-file-converter

📚 Import Bibtex publications and Jupyter Notebook blog posts into your Markdown website or book. 将Bibtex转换为Markdown网站

Home Page:https://docs.hugoblox.com/reference/content-types/#automatically-import-publications-from-bibtex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BibTeX superscripts in math environment parsed wrong

trappitsch opened this issue · comments

When converting a bibtex file with a superscript somewhere, the curly brackets are not parsed. For example, if the title contains:

A $^{32}$S isotope

This ends up being:

A $^32$S isotope

In the clean_bibtex_str(s) routine on line 276 of cli.py these curly brackets would be replaced with nothing by the command in line 280:

s = s.replace("{", "").replace("}", "")

However, printing out s at the beginning of this routine shows that the title never arrives with a curly bracket in it. Not sure if this is a problem with bibtexparser or with academic-admin, but any fix would be very interesting. Alternatively, how would you solve such a title?

Seems to be related to this issue in bibtexparser.

Writing out the bibliography into the cite.bib finally contains the same error, in the example above it would say:

...    
title = {A $^32$S isotope},
...

Hmmm...

commented

This issue has been automatically marked as stale because it has not had any recent activity. The resources of the Academic team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically close soon if no further activity occurs. Thank you for your contributions.