retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.4k stars 289 forks source link

Add postfix to both conficting citation keys #3043

Closed rytverhagen closed 3 weeks ago

rytverhagen commented 3 weeks ago

Debug log ID

CTEETQF2-refs-euc/6.7.248-7

What happened?

When two citation keys conflict (e.g., "Birch 2022"), BB renames keeps one "Birch 2022" and renames the other "Birch 2022a". I am trying to get it to rename both into "Birch 2022a" and "Birch 2022b". I use the following citation key formula "" [auth:lower][year][=].

retorquere commented 3 weeks ago

[auth:lower][year][=] is in the legacy format, and it isn't a valid formula yet, because [=] needs a number, but eg [auth:lower][year][=0] would automatically be translated to the new format (displayed under the current formula while you're editing):

auth.lower + shorttitle(3,3) + year

to get what you want you would add a postfix term:

auth.lower + shorttitle(3,3) + year + postfix(start=1)

but note that this will always postfix a letter, not just when disambiguation is needed.

rytverhagen commented 3 weeks ago

Thank you! I tried and it works. So, if i understand correctly it is currently impossible to do this only when disambiguation is needed. In this case, I will do it manually.
(The reason I’d like this to work is because handling citation keys this way matches how in-text citations are handled in the actual literature I work with).

On 30 Oct 2024, at 13:07, Emiliano Heyns @.***> wrote:

[auth:lower][year][=] is in the legacy format, and it isn't a valid formula yet, because [=] needs a number, but eg [auth:lower][year][=0] would automatically be translated to the new format (displayed under the current formula while you're editing):

auth.lower + shorttitle(3,3) + year to get what you want you would add a postfix term:

auth.lower + shorttitle(3,3) + year + postfix(start=1) but note that this will always postfix a letter, not just when disambiguation is needed.

— Reply to this email directly, view it on GitHub https://github.com/retorquere/zotero-better-bibtex/issues/3043#issuecomment-2446909139, or unsubscribe https://github.com/notifications/unsubscribe-auth/BMRKA2WAOJUXNKHLG7XHK3DZ6DDZZAVCNFSM6AAAAABQ347W4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBWHEYDSMJTHE. You are receiving this because you authored the thread.

retorquere commented 3 weeks ago

That is indeed currently the case