# Customising key patterns for citation keys

**URL:** <https://discourse.jabref.org/t/customising-key-patterns-for-citation-keys/2310>\
**Category:** Help\
**Created:** [September 22, 2020, 4:31pm UTC](https://discourse.jabref.org/t/customising-key-patterns-for-citation-keys/2310 "2020-09-22T16:31:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![opems](https://avatars.discourse-cdn.com/v4/letter/o/c37758/32.png) [@opems](https://discourse.jabref.org/u/opems)\
**Post date:** [September 22, 2020, 4:31pm UTC](https://discourse.jabref.org/t/customising-key-patterns-for-citation-keys/2310/1 "2020-09-22T16:31:35Z")

</div>

Hi,

I’m looking to customise the key patterns for generating citation keys, but I can’t see if it’s possible to get the results I want.

I’m looking for the citation keys to be the first two letters of each author name, followed by a colon and the short date.

So, for example, [this paper](https://www.jstor.org/stable/2118559) would have citation key Wi:95, and [this paper](https://www.sciencedirect.com/science/article/pii/0022314X83900021) would have citation key CaErPo:83.

I’m not sure if what I want to do is possible, but if it is, I’d appreciate some help as to how to do it!

Thanks!

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [September 22, 2020, 5:35pm UTC](https://discourse.jabref.org/t/customising-key-patterns-for-citation-keys/2310/2 "2020-09-22T17:35:13Z")

</div>

Hi,  
have you checked the documentation? See also the hint on the pressing of enter.  
Your pattern would be somehow a combination of  
**[**  **`authIniN`** **]** : The beginning of each author’s last name, using no more than N characters.  
And  
**[**  **`shortyear`** **]** : The last 2 digits of the publication year

[https://docs.jabref.org/setup/citationkeypatterns](https://docs.jabref.org/setup/citationkeypatterns)

---

<div class="post-metadata">

**Author:** ![k3KAW8Pnf7mkmdSMPHz2](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/k3kaw8pnf7mkmdsmphz2/32/1116_2.png) [@k3KAW8Pnf7mkmdSMPHz2](https://discourse.jabref.org/u/k3KAW8Pnf7mkmdSMPHz2)\
**Post date:** [September 22, 2020, 9:39pm UTC](https://discourse.jabref.org/t/customising-key-patterns-for-citation-keys/2310/3 "2020-09-22T21:39:30Z")

</div>

Unfortunately, in this case the documentation is misleading for `[authIniN]`.  
@Siedlerchr I’ll try to update the documentation this week.

I don’t think it is possible to do for an arbitrary number of authors, however, `[authN_M]` returns an empty string if the author does not exist, so chaining 5+ of those should cover most use cases (something like `[auth2_1][auth2_2]...`)

---

<div class="post-metadata">

**Author:** ![opems](https://avatars.discourse-cdn.com/v4/letter/o/c37758/32.png) [@opems](https://discourse.jabref.org/u/opems)\
**Post date:** [September 23, 2020, 10:54am UTC](https://discourse.jabref.org/t/customising-key-patterns-for-citation-keys/2310/4 "2020-09-23T10:54:27Z")

</div>

Thanks.

I wasn’t sure if it was possible to use some regex-fu to get what I wanted from `[authors]`, but I may just need to investigate that a bit further myself.

It’s really helpful to know that `[authN_M]` is empty when the author doesn’t exist though - thanks.
