Correcting flawed BibTeXkeys containing keywords

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
larilela
Posts: 24
Joined: Mon Jan 21, 2019 12:47 pm

Correcting flawed BibTeXkeys containing keywords

Post by larilela »

I generated BibTeX keys for an existing library and realized that a lot of the generated keys were flawed as they contained keywords instead of author and year. I am guessing this is because when autocompleting from the internet some references mistakenly imported keywords into the U1 field. Is there any easy and quick way to correct that or scan all BibTex keys for that error?
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Correcting flawed BibTeXkeys containing keywords

Post by Jon »

You can reset BibTeX keys with Refs -> Generate BibTex Key.

Jon
Sonny Software
larilela
Posts: 24
Joined: Mon Jan 21, 2019 12:47 pm

Re: Correcting flawed BibTeXkeys containing keywords

Post by larilela »

That's how i generated them in the first place (and how I am assuming the keywords that some autocomplete from the Internet filters must have pasted into the key field ended up there). Repeating Ref-> Generate BibTeX Key on those flawed existing keys doesn't change them unfortunately
larilela
Posts: 24
Joined: Mon Jan 21, 2019 12:47 pm

Re: Correcting flawed BibTeXkeys containing keywords

Post by larilela »

It does work if I first empty the key field and then reset with Ref > generate BibTeX key. But that way I would still manually have to go through 1000+ entries to find out which ones have authorYYY and which ones have random keywords separated by semicolons in the key field
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Correcting flawed BibTeXkeys containing keywords

Post by Jon »

You don't have to clear the field first. And you can select all your references at once and do this -- if the key was OK before in a reference, it will be regenerated as was. BUT, this function creates the key based on what's in the Author and Date field. If there is garbage there it will be reflected in the new citekey. You'd have to clean up those fields first (perhaps with Autofill From Internet, if those references have a PMID or DOI).

Note: this function was broken in 13.5 and 13.5.1.. It will work again in the next update, coming soon. So please revisit this when it's available.

Jon
Sonny Software
larilela
Posts: 24
Joined: Mon Jan 21, 2019 12:47 pm

Re: Correcting flawed BibTeXkeys containing keywords

Post by larilela »

This doesn't seem to be working for me. I've tried it e.g. on a reference, which had "gendev" (gibberish created probably from a key word such as gender) as a city key, after I first pressed Generate BibTeX Key, "Judith Butler" as author and "2004" as year. No matter how often I click on Generate BibTeX Key, the key will still remain "gendev" and not become "butler2004" . If I empty the key field and press Generate BibTeX Key it works. Any ideas on how to fix this?
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Correcting flawed BibTeXkeys containing keywords

Post by Jon »

Did you read my comment above to the end?

Jon
Sonny Software
larilela
Posts: 24
Joined: Mon Jan 21, 2019 12:47 pm

Re: Correcting flawed BibTeXkeys containing keywords

Post by larilela »

I thought the comment pertained to the latter part of the message (cleaning the fields via Autofill from the internet) but got it now. Thanks
Post Reply