Multiple citation issues with distill blog.

Hey y'all! I'm having a couple citation issues with my distill blog and I'm not sure if it's a problem on my end or if I need to open an issue. I'm trying to recreate a paper I originally wrote in bookdown where I did not have these problems.

Issue 1: Doubled footnotes when using custom CSL.
I downloaded the Chicago Manual of Style 17th edition (note, with Ibid.) CSL file and added it to the folder for my post. When I began citing, distill automatically created a references.bib file to the folder. My YAML looks like:

---
title: "Health and Housing"
description: |
  Exploring the link between housing and health.
date: 2021-11-02
output:
  distill::distill_article:
    self_contained: false
csl: chicago-note-bibliography-with-ibid.csl
bibliography: references.bib
---

This changes the citations to format correctly in text, but on hover it formats both the native and custom citation styles:

(side question: do I need to add the custom CSL to each post's folder or is there a way to add it site-wide? Maybe this is related to my problem?)

Issue 2: Trying to add page numbers breaks the citation.
When citing in bookdown, I had no trouble following the Pandoc citation guidelines for adding page numbers. But in distill, trying to add page numbers turns the citation into a blockquote or something:

Screen Shot 2021-11-02 at 10.12.41 PM

I tried formatting the page numbers multiple ways but each attempt led to this error.

[@soifer2014 7]
[@soifer2014, p. 7]
[@soifer2014, {p. 7}]

If anyone could help, that'd be great! Thank you.

update: It appears Issue 2 is related to the Visual Markdown Editor; switching it off shows that it converts the citation as soon as I add the page number:

\[@soifer2014 7\]

And removing the slashes and reknitting fixes the problem. But this is incredibly inconvenient; I can't easily add citations without the visual editor, but as soon as I re-enable it, the slashes return. Also I wrote my previous bookdown paper entirely in the visual editor and didn't run into this problem.

About 2 I think this is related to an issue in RStudio IDE: I saw this one which seems related:

maybe there are others.

Regarding 1, can you open an issue in distill repo with a reproducible example so that we can look into this ? It seems like an issue with this specific CSL style

1 Like

Thank you! I created an issue here:

Related to your page number problem? Backslashes are added to citations when using the RMarkdown Visual Editor, resulting in the incorrect rendering of documents · Issue #10075 · rstudio/rstudio · GitHub

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.