Dear all,

A couple of years ago, an Apple script was circulated on this list to get
BibDesk to generate citekeys following the schema below:

1) McCracken_2004 for a single author
2) McCracken_and_Maxwell_2004 for two authors
3) McCracken_et_al_2004 for 3 or more authors

Essentially, what is different from the current possibilities in the
autogeneration syntax, when etal is triggered by too many authors, only the
first author is printed instead of printing second [and third] as well
before etal.

Is it possible to implement something similar for the generation of PDF
names for the Auto-file option?
Has anyone tried that?
I'm modifying my autofile routine and would very much like to implement a
scheme similar to the one mentioned above.


Also, for the developers, might this be something worthy of implementing in
the autogeneration syntax in a future release?
It would allow citekeys to follow more closely how most citation styles
handle in-text citations.
In my field, we always use author-date citations, so I try to keep citekeys
as close to how they'll end up looking eventually in the output.
I am not aware of any citation style that uses et al. with more than one
author, so in my view it would make sense to only print firstauthors as
soon as etal is triggered by whatever number of authors is specified.

What are conventions that others use?

Thanks very much!

Jan




On Mon, Nov 17, 2014 at 3:21 AM, Jan Jakob Bornheim <jjbornh...@gmail.com>
wrote:

>
> On 17 Nov, 2014, at 01:26, Christiaan Hofman <cmhof...@gmail.com> wrote:
>
>
> On Nov 13, 2014, at 22:55, Jason Tilley wrote:
>
> I recently switched from JabRef to BibDesk since JabRef is dependent on
> Java and Apple is dependent on making Java a major pain. I would like to
> automatically create cite keys that are in the same style as my existing
> bibliography. Currently my cite keys are like the following examples:
>
> 1) McCracken_2004 for a single author
> 2) McCracken_and_Maxwell_2004 for two authors
> 3) McCracken_et_al_2004 for 3 or more authors
>
> The closest I can get to this with a custom cite key format is using the
> string:
>
> %a[][_et_al]1_%Y
>
> This works for works with one or three or more authors well, but this
> can’t handle instances with 2 authors. Does anyone know how to do this? Is
> there maybe a way to embed an if statement in my format string? Any help
> with this would be greatly appreciated. Thanks.
>
>
> No, this level of complexity is not supported.
>
> Christiaan
>
>
> My usual answer: You could use AppleScript. It’s not very elegant, nor
> fast, but it gets the job done.
>
> Cheers,
> Jan Jakob
>
> Something like this should get you started:
>
> *tell* *document* 1 *of* *application* "BibDesk"
>
>
> *set* thePubs *to* selection
> *set* theLetters *to* "abcdefghijklmnopqrstuvwxyz" # these are the unique
> identifiers added to ambigous cite keys
> *set* theUsedCiteKeys *to* {} # we have to keep track of the cite keys
> already assigned in this AppleScript run to avoid assigning  the same cite
> key twice
>
>
> *repeat* *with* thePub *in* thePubs
> *set* shouldRepeat *to* *true*
> *set* i *to* 1
>
>
> *set* theAuthors *to* *authors* *of* thePub
> *set* theYear *to* publication year *of* thePub
> *set* theAuthorsCount *to* (*get* *count* *of* theAuthors)
>
>
> # Determine the cite key format
>
>
> *if* theAuthorsCount *is* 1 *then*
> *set* theGeneratedCiteKey *to* last name *of* *item* 1 *of* theAuthors &
> "_" & theYear
> *else* *if* theAuthorsCount *is* 2 *then*
> *set* theGeneratedCiteKey *to* last name *of* *item* 1 *of* theAuthors &
> "_and_" & last name *of* *item* 2 *of* theAuthors & "_" & theYear
> *else*
> *set* theGeneratedCiteKey *to* last name *of* *item* 1 *of* theAuthors &
> "_et_al_" & theYear
> *end* *if*
>
>
> # Now let's test whether there is already any publication that has the
> same cite key or if we have already used the same cite key in this session
>
>
> *set* *the* theProvisionalCiteKey *to* theGeneratedCiteKey
>
>
> *repeat* *while* shouldRepeat *is* *true*
> *set* theOtherPub *to* *get* (*publications* *whose* cite key *is*
> theProvisionalCiteKey)
> *if* theOtherPub *is* {} *and* theProvisionalCiteKey *is not* *in*
> theUsedCiteKeys *then*
> *set* shouldRepeat *to* *false*
> *else*
> *set* theProvisionalCiteKey *to* theGeneratedCiteKey & "_" & *item* i *of*
>  theLetters
> *set* i *to* i + 1
> *end* *if*
> *end* *repeat*
>
>
> *set* theFinalCiteKey *to* theProvisionalCiteKey
>
>
> # Now we assign the new unique (at least within the thePubs group) cite key
>
>
> *set* cite key *of* thePub *to* theFinalCiteKey
> *set* theUsedCiteKeys *to* theUsedCiteKeys & theFinalCiteKey
>
>
> *end* *repeat*
>
>
> *end* *tell*
>
> ------------------------------------------------------------
> ------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/
> 4140/ostg.clktrk
> _______________________________________________
> Bibdesk-users mailing list
> Bibdesk-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bibdesk-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-users mailing list
Bibdesk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to