0

I am working with EMACS/Zotero/rmarkdown. Zotero is linked to EMACS with zotxt.

The in line citations are not following the .csl format correctly. For example, using the American Psychological Association 7th edition (apa.csl) format, in line citations should be in as follow:

(R Core Team, 2022)

But I am getting:

R Core Team (2022)

MRE is:

---
title: "literature review"
author: "Me"
date: "06/22/2022"
output: pdf_document
bibliography: references.json
csl: apa.csl
---

## Test text
This is just a test @rcoreteam2022. That citation should appear as 
"(R Core Team, 2022)", but it does not.

## References

Pdf screenshot

enter image description here

The pdf is rendered with:

render("mre.rmd", "pdf_document")

The .csl should be correct, I exported it out of Zotero and the Zotero preview gives the correct format.

Jacob
  • 173
  • 8
  • How do you convert markdown to pdf. pandoc? If so, it's not related to emacs. – Tianshu Wang Jun 22 '22 at 14:18
  • Yes, I use pandoc. Just trying to explain the framework that I am using. And you are correct, I get the same results in RStudio. – Jacob Jun 22 '22 at 14:43
  • You can look at this https://stackoverflow.com/questions/14288699/pandoc-not-converting-latex-style-citations-correctly. If this doesn't solve your problem. I suggest you add your `pandoc` options like that question. – Tianshu Wang Jun 23 '22 at 03:03

1 Answers1

1

After a bunch of searching, I figured it out. I found this blog post helpful: https://plantarum.ca/2020/07/20/blogdown-citations/ Basically, my citation keys need to be in brackets, so instead of:

This is just a test @rcoreteam2022. 

I need to use:

This is just a test [@rcoreteam2022]. 

And for multiple citations:

This is just a test [@rcoreteam2022; @Smith_2002]. 
Jacob
  • 173
  • 8