Insert a "XXXX et al." citation.

See original GitHub issue

Before everything, thank you so much for this wonderful plugin ! It’s a joy to use !

What is proposed

To make it even more flexible, I’d love to be able to add a proper XXXX *et al.*, YYYY citation type in Markdown format. This is in the particular case of wanting your markdown notes to be properly formatted without being parsed by pandoc.

In Markdown, this would look like:

As it is said by [Test *et al.*, 2018](link/to/paper), blablabla

Rendered, it would look like:

As it is said by Test et al., 2018, blablabla

As of today, the plugin is already almost capable of doing this, using an extremely convoluted handlebars sentence:

[{{#each entry.author}}{{#if @first}}{{#if this.family}}{{this.family}}{{#unless @last}} *et al.*{{/unless}}{{else}}{{../authorString}}{{/if}}{{/if}}{{/each}}, {{#if year}}{{year}}{{else}}no date{{/if}}]({{zoteroSelectURI}})

What the sentence does is to:

  1. Display the family name of the first author (if it has one)
  2. Add “et al.” next to it if this first author if it is not the last author of the list of authors (if not, write nothing since there’s no other authors)
  3. If the author has no family name or given name (which happens when it’s an organization with only one name), I can’t get the name of the author via this.given or this.family; so, the sentence writes the authorString in full (not ideal)
  4. If there is a year, add it.
  5. As a link, add the zotero select URI (my personal preference; can be replaced by the DOI URL via https://doi.org/{{DOI}} or other URL)

It works pretty well, but it seems a bit complex for most users. It took me a lot of time myself 😄 !

What is needed

Ideally, I imagine that allowing the use of a csl file to custom the appearance of this citation would be ideal; but it would require a lot of work.

Using this type of long handlebar syntax could be good, but needs to be explained to the users properly; maybe this example could be given ?

If it is given, it could be nice to think of a way to replace the authorString in case the name of the author cannot be gathered via this.given or this.family. If you have a pointer for that, I’d be much obliged.


Thanks again for your work !

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
hanscommented, May 14, 2022

Hi all, I’m impressed by your Handlebars solutions here! CSL-driven automatic rendering of inline citations will be coming in the next major release. Stay tuned!

2reactions
geblancocommented, Jan 4, 2022

This sounds really good, after wandering around I’ve come to your solution and as non-TS guy, it saved my day, thanks @Klemet!

Read more comments on GitHub >

github_iconTop Results From Across the Web

When to Use Author "et al." in Citation and References
Learn when to use "author et al." in citations and references. APA, Chicago, and MLA styles. "Et al." citation examples and guides.
Read more >
APA Style: 7th edition - Citation Guide - LibGuides
Include the name of only the first author plus “et al.” in every citation. Add the year and page numbers (if there are...
Read more >
APA Citation Basics
Works with three to five authors: • Include all names in the first in-text parenthetical citation, separated by commas and then an ampersand...
Read more >
Appendix 3: APA reference style - Sage Publications
All references in the text and notes must be specified by the authors' last ... If author's name is not in the text,...
Read more >
How To Cite a Research Paper: Citation Styles Guide
Chambers et al. (2010) put forward a model… If the author information is not available, you can use the source title to replace...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found