Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

More flexible citation formats

I love to use citations in my r bookdown projects.

The format is not very flexible, I can use @citeID to get "Author(Year)" or [@citeID] to get "(Author Year)".

Sometimes I only need "(Year)" or "Year" or I may only need "Author Year" with no parentheses at all.

Finally I need to add a page reference to the citation like "Author (Year:Pages)"

Can anybody give me a hint, where the relevant code sits in the source so that I can start adding some cite-formats as described above?

like image 750
kadewe Avatar asked Jun 25 '17 12:06

kadewe


1 Answers

There are many citation modifications offered by Markdown, many of which you can find in the Pandoc Users Guide. With them you can hide the author, make page references, etc.:

  • @Einstein1905 -- Einstein et al. (1905)
  • [@Einstein1905] -- (Einstein et al., 1905)
  • [see @Einstein1905, pp. 23-42] -- (see Einstein et al., 1905, pp. 23-42)
  • Einstein was right [-@Einstein1905] -- Einstein was right (1905)

Details like switching off paranthesis or other punctuation related issues can be regulated in detail by designing your own biblatex style. These style files can be tested here and can be referenced during markdown conversion using commands like --biblatex.

like image 141
Martin Avatar answered Sep 20 '22 18:09

Martin