More flexible citekey generation

A place for users to ask each other questions, make suggestions, and discuss Bookends.
DrJJWMac
Posts: 345
Joined: Sat Jun 22, 2019 8:04 am
Location: Alabama USA

Re: More flexible citekey generation

Post by DrJJWMac »

Dellu has a good perspective. I had especially forgotten about the limitations on _ in LaTex. I am not certain whether BibTeX makes an exception or not (e.g. the hyperref package allows _ without escaping). An alternative might be a colon : character. In any case ... no underscore, either colon or nothing. In addition, absolutely no spaces in the ShortTitle or LibraryName suffixes. I have a reference that says that while spaces *can* be used in citation keys, they have been known to cause problems and should be avoided.

As an additional note, I remembered this morning that one of the simpler citation key formats was Author + Year (+ letter suffix if not unique). This would give

Smith2022
Smith2022a
Smith2022b
...

The principle is that the chance you have more than 27 documents in your citation database that have the same first author in the same year is ... negligible.

I would argue the first letter of the suffix for ShortTitle or LibraryName should be Capitalized and the rest can be whatever.

@Dellu ... interesting that you will use alpha and beta for library names. I would wonder how you will reference them in the citation keys in a LaTeX source, since a LaTeX source is ASCII text ??? \cite{Smith2022\alpha}.

Summary
--
A + Y --> Smith2022, Smith2022a, Smith2022b, ...
A + Y + ID --> Smith20223333 or Smith2022:3333
A + Y + ST --> Smith2022Somedaysometime or Smith2022:Somedaysometime
A + Y + LN --> Smith2022Books or Smith2022:Books
--
JJW
Dellu
Posts: 268
Joined: Sun Mar 27, 2016 5:30 am

Re: More flexible citekey generation

Post by Dellu »

Dellu has a good perspective. I had especially forgotten about the limitations on _ in LaTex.
A + Y + LN --> Smith2022Books or Smith2022:Books
either colon or nothing.
Thank you so much for understanding dear DrJJWMac. This means a lot for me because I am extremely invested on this feature. I will be extremely grateful if this feature will come with Smith2022Books pattern.

I would argue the first letter of the suffix for ShortTitle or LibraryName should be Capitalized and the rest can be whatever.
I agree, and this is completely in our hands. So far we name our library in capital letter the formatting will respect that.
@Dellu ... interesting that you will use alpha and beta for library names. I would wonder how you will reference them in the citation keys in a LaTeX source, since a LaTeX source is ASCII text ??? \cite{Smith2022\alpha}.
I am using Xelatex engine which accepts the Greek letters as they are (full unicode).
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: More flexible citekey generation

Post by Jon »

Here is what I've implemented so far (note that I haven't enforced first letter capitalization of the short title because I think it's worth preserving the context, for those who don't just use the citekey as a dumb unique identifier but also to get some idea of which reference is being cited). I've used the colon for the same reason, to make it easier to see that the unique ID and library name don't belong to the reference itself. I've left the short title as is to indicate the opposite. People aren't going to mix styles, so internal consistency isn't necessary, it's what best fits the data chosen to display,

Author + year: Jensen2001
Author + year + uniqueID: Jensen2001:229849
Author + year + shortTitle: Jensen2001movin
Author + year + library: Jensen2001:Library1

As always, spaces and certain other forbidden characters are stripped out of the final product.

Agreed? Or is modification still requested?

Jon
Sonny Software
DrJJWMac
Posts: 345
Joined: Sat Jun 22, 2019 8:04 am
Location: Alabama USA

Re: More flexible citekey generation

Post by DrJJWMac »

I follow your reasoning and the formats look good to me. I defer that @Dellu and/or others may appreciate when the colon does not appear at all. Either case (with or without colon) is fine with me.

Thanks for allowing the open discussion on this.
--
JJW
Dellu
Posts: 268
Joined: Sun Mar 27, 2016 5:30 am

Re: More flexible citekey generation

Post by Dellu »

DrJJWMac wrote: Sun May 08, 2022 5:15 pm I defer that @Dellu and/or others may appreciate when the colon does not appear at all. Either case (with or without colon) is fine with me.

Thanks for allowing the open discussion on this.
Thank you so much dear DrJJWMac for pointing that out.

Dear Jon, can you help me by removing the colon from the last pattern please?

I would really appreciate if you make it like this: Author + year + library: Jensen2001Library1
I know I am being selfish here because I have no logic to convince you one over the other. I just want to ask help. The colon is going to wreck my fine renaming format which depends on the Key.

The other patterns are fine with me.
iandol
Posts: 465
Joined: Fri Jan 25, 2008 2:31 pm

Re: More flexible citekey generation

Post by iandol »

My personal preference would be for CamelCase without hyphens, semicolons or underscores, I'm not quite sure what advantage making citekeys longer (even if just by 1 character) has?
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: More flexible citekey generation

Post by Jon »

Making the library name CamelCase is OK. But what about the unique ID? Any objection to a colon between the date and the uniqueID?

Jon
Sonny Software
Dellu
Posts: 268
Joined: Sun Mar 27, 2016 5:30 am

Re: More flexible citekey generation

Post by Dellu »

Jon wrote: Mon May 09, 2022 6:49 am Making the library name CamelCase is OK. But what about the unique ID? Any objection to a colon between the date and the uniqueID?

Jon
Sonny Software
Sure, I think keeping a colon between the date and the UniqueID is a good idea because they are all numbers (would be hard to parse for the eye).

Dear Ian, thank you!
Post Reply