pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Provide Markdown syntax for author-only citations (i.e., equivalent to BibTeX's \citeauthor{})

Open krivit opened this issue 4 years ago • 2 comments

This issue was originally https://github.com/jgm/pandoc-citeproc/issues/377, moved here on @jgm's suggestion. https://github.com/jgm/pandoc/issues/2335 is related but different, because that issue does not concern Markdown.

Currently, Pandoc's citation mechanism lets you suppress the author via a hyphen, as in, [-@jon90]. It would be helpful to be able to suppress the year instead, particularly when using a possessive form, as in

Jones (1990) proposes accomplish this by reversing the polarity on the dilithium crystal. We disagree with Jones's approach, because...

(automatically inserted elements italicised).

One possible syntax for this might be for -@jon90 to suppress the year the way [-@jon90] suppresses the author. This is because in a typical use case, the year would be typeset in parentheses, whereas the author's name would be typeset without. Then, one would write the above as

@jon90 proposes accomplish this by reversing the polarity on the dilithium crystal.
We disagree with -@jon90's approach, because...

@cormacrelf (https://github.com/jgm/pandoc-citeproc/issues/377#issuecomment-459391092) proposed a different syntax, writing

syntax gets a bit trickier, but the mental model is “select which part of the cite you want”. I don’t think a context-dependent meaning of -@doe maps well to this. -@doe should mean “DROP the author/parties/inline-able part” whether inside or outside square brackets and another symbol should do the opposite. Maybe +@doe would reflect this opposite.

krivit avatar Apr 30 '21 00:04 krivit

It is both a useful and wished for feature. I will suggest the syntax @jon90- and [@jon90-] with a hyphen after the key. So, prefix hyphen means omit author name and suffix hyphen would mean omit year.

chrwahl avatar Mar 15 '22 15:03 chrwahl

that would be really helpful. Any updates on that one?

s4npii avatar Jul 19 '22 07:07 s4npii

In an ideal world, I think the desired field could be passed as an arg to the filter. So, [@Jones2023]{field=author} or [@Jones2023]{field=title}. I know its a bit more verbose than simply @Jones2023- but it would make it considerably more flexible.

bcdavasconcelos avatar Feb 25 '23 00:02 bcdavasconcelos

This is now possible using a Lua Filter: https://github.com/bcdavasconcelos/citefield.

bcdavasconcelos avatar Mar 11 '23 16:03 bcdavasconcelos