Better BibTeX Citation key format help

edited June 12, 2022
Hello everyone!

I'm new to Zotero, and currently trying to set up my citation key format in the plugin Better BibTex. I can't for the life of me figure out how to use the parameters for the functions even though it should be a simple process.

What I would like to achieve is`authEtal2.lower` with the separation `_` instead of `.` between authors.

The parameters for the functions are listed here: https://retorque.re/zotero-better-bibtex/citing/

Parameter = sep
Type = string
Default value = '.'

Can anyone help?

Edit: I figured it out. Correct format would be `authEtal2(sep='_').lower`.
  • In the case of the underscore, authEtal2(sep=_).lower will also work.
  • That looks cleaner. Thanks!
  • edited June 14, 2022
    It's a bit of a special case; anything that could be a valid javascript variable name doesn't need quotes, but the only non-alphanum characters that qualify are _ and $
  • Hi I'm new to Zotero and using Better BibTex. I'd like to cite this way -now explained with "some English some code":

    Author1.Author2.etal:lower_year

    So that it looks like as these examples:

    BookName | Authors | Year | Citation Key
    --------- | ------ | ---- | ----------
    Introduction | Agirre and Edmonds | 2007 | agirre.edmonds_2007
    Word Sense | Agirre and Edmonds | 2007 | agirre.edmonds_2007a (add a, b, c... when repeated)
    Knowledege | Aguilera | 2011 | aguilera_2011
    Beyond Modal | Adolphs et. al | 2011 | adolphs.etal_2015

    Could you please assist me with this?
    I'm using it with Obsidian and the citation key on one side doesn't match with the established in Zotero preferences, on the oteher, I don't know how to set it in order to cite like in the example above.

    Thank you so much!
  • What do you currently have set in BBT? I'm also not clear what you mean by this:
    I'm using it with Obsidian and the citation key on one side doesn't match with the established in Zotero preferences, on the oteher
    The citation on what side?
  • Author1.Author2.etal:lower_year
    That's not a valid citation key formula in either the old or the new format. Maybe you mean authEtal2(sep=_).lower + '_' + year?
  • edited April 14, 2023
    Thanks for your replies!!!
    My last try in Zoteron citation key -the current one- is:

    Citation key:
    authEtal2(sep='_').lower + '_' + year

    but, something is not right because it adds on a second field

    Active citation key:
    authEtal2(sep='_').lower + '_' + year

    with the same data. And I observed that it adds this second field "Active citation key..." when something is wrong.

    I'd like to show it the way I listed above in the table example.

    However, in this very moment resulting citations keys in Zotero look this way:

    agirre_edmonds2007 (not agirre.edmonds_2007)
    agirre_edmonds2007a (not agirre.edmonds_2007a)

    and when I cite it in Obsidian, look this way:

    @agirreIntroductionToWorld2007 (it wrongly mentions just one Lastname1+Word1,2,3fromTitle+year, instead of @agirre.edmonds_2007)

    If you need some more information to understand better just tell me.
    Thanks again!


  • authEtal2(sep='_').lower + '_' + year is a valid formula. It is correct that if the "active formula" screen shows that there is an error in the formula being entered.
    However, in this very moment resulting citations keys in Zotero look this way:agirre_edmonds2007 (not agirre.edmonds_2007)
    If you want the latter, use authEtal2(sep='.').lower + '_' + year

    If you want further help, please open an issue on https://github.com/retorquere/zotero-better-bibtex/issues. I can help there much better than here.
  • Thank you Emiliano, I'll write to you in github since I tried the last you said and didn't work either, "Active citation key formula" still shows. Here is the link https://github.com/retorquere/zotero-better-bibtex/discussions/2488
  • That link gives me an error, it says that page does not exist.
  • Hi Emiliano, my account has been flagged and I don't know why. I contacted support but still don't have an answer. I can send you the debug ID log to where you tell me. Thanks!
  • You can post it here.
  • CSAMY8FY-refs-euc
  • https://github.com/retorquere/zotero-better-bibtex/issues/2490 has a new build that contains logging. It is not a fix, just for diagnosis. Please turn on debug logging in the help menu, try to change the formula, then send a new debug log.
  • Hi Emiliano, sorry for the delay, I couldn't connect sooner. In the meantime, I noticed that now the citation key showed itself how I wanted, but not in the older references, so I refreshed them and they all look good. I used what you suggested:

    authEtal2(sep='.').lower + '_' + year

    The PROBLEM STILL IS that it shows the second field "active citation key formula"

    I show you all in these screenshots:

    2 authors (ok); https://drive.google.com/file/d/19weL5c8jU2kqJ6PFoxx9jhEN9NHtizci/view?usp=sharing

    3 authors (ok):
    https://drive.google.com/file/d/1IC-JicwGx7qFHPKpP80SARr9MwAxvSnf/view?usp=sharing

    current configuration (here you can see the remaining problem of two fields):
    https://drive.google.com/file/d/1TyMg5bHPqlq08uhKGtvjociCUR-F0mv8/view?usp=sharing

    Mentioned all this, should I still reinstall the better-bibtex add-on in zotero with this https://github.com/retorquere/zotero-better-bibtex/issues/2490 ?

    Thank you!!!! <3
  • edited April 19, 2023
    Yes. I understand how things look in your prefs screen, I don't understand why they look that way in your prefs screen. Please install it, turn on debug logging in the help menu, try to change the formula, then send a new debug log.

    Has the problem with your GH account been resolved? It is really a lot easier for me to do support on GH issues rather than here.
  • Can't do anything without further feedback.
  • edited April 24, 2023
    Hi Emiliano, sorry for the delay. Just happened to be doing workshops so I was almost offline.
    I go to https://github.com/retorquere/zotero-better-bibtex/issues/2490 to install what you said and when I clicked on "test build 6.7.75.4157" it shows 404-page. Do you know why?

    Is it equally useful just sending you here the debug ID log after trying to change the citation key formula?
    In case yes, I changed the citation key formula to "year", saved. Closed the app. Opened, then changed again to "authEtal2(sep='.').lower + '_' + year", saved. Closed the app. Open, and clicked right in one reference entry, did the debug and the ID is this:

    7SRC3QIS-refs-euc

    Then I clicked Finish.

    I'll be online now.

    My GH account is still flagged, I haven't received response.
  • Debug build expire after approximately one week. 7SRC3QIS-refs-euc does not contain the information I need. https://github.com/retorquere/zotero-better-bibtex/issues/2490 has a new debug build up.
  • edited April 25, 2023
    I did it, and the new debug log id is this: MJY2B7ZG-refs-euc

    I also realized that it did allow me to reply to you in the github discussion. You can see it in your last link.
    Does that mean that the flagged issue is resolved?

    Thank you so much for helping me!
  • Hi I am experiencing something similar. The Citation Key Formula is "Auth.Etal2.fold + '-' + year" however there's a second field called "Active citation key formula" with value "(auth.lower + year)" and any new resources added to the library adopts the "active" formula. I cannot edit the "active" formula. I submitted Debug ID: D1391963206 which was recorded whilst unpinning a few resources that use the "Active" value. Thanks in advance for advice or assistance on this.
  • I can't access those logs, and please report this on the github project. That's where I do support.
  • I would like to use "zotero" to generate keys;
    but no matter what I try, it keeps generating in the preset format:

    author3WordsYear
  • That is, if you will let me.
  • Hello,
    I need all citations to be: Author year [no space, "Author" is capitalized]
    I managed to copy BetterBibtex setting from one computer to another, but still on the new Windows computer capitalized are only the names where the paper is archived on Zotero. Extremely inconvenient, incompatible with other machines.

    PLEASE HELP!!!
    Thank you
  • Please don't shout.

    If you want my help, ask on github. I have support tooling built around github issues.
Sign In or Register to comment.