Insert a "XXXX et al." citation.
See original GitHub issueBefore 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:
- Display the family name of the first author (if it has one)
- 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)
- 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.givenorthis.family; so, the sentence writes the authorString in full (not ideal) - If there is a year, add it.
- 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:
- Created 2 years ago
- Reactions:6
- Comments:7 (2 by maintainers)
Top Related StackOverflow Question
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!
This sounds really good, after wandering around I’ve come to your solution and as non-TS guy, it saved my day, thanks @Klemet!