Search code examples
rr-markdownmarkdownbibtex

Is it possible to remove parentheses from in-text citations in R?


I'm trying to remove a parenthesis from a citation that is already within a parenthesis. At the moment my markdown text looks as follows:

The questionnaire Patient Health Questionnaire 9-Item Scale (PHQ-9; [@Kroenke2010]) was used to assess symptoms of depression.

Which ends up like this:

The questionnaire Patient Health Questionnaire 9­Item Scale (PHQ­9; (Kroenke, Spitzer, Wil­liams, & Löwe, 2010)) was used to assess symptoms of depression.

I've tried to change the markdown text to (aka removing the brackets around the citation):

The questionnaire Patient Health Questionnaire 9-Item Scale (PHQ-9; @Kroenke2010) was used to assess symptoms of depression.

Which marginally improves how it looks:

The questionnaire Patient Health Questionnaire 9­Item Scale (PHQ­9; Kroenke, Spitzer, Wil­liams, & Löwe, (2010)) was used to assess symptoms of depression.

I'd like for it to look like this:

The questionnaire Patient Health Questionnaire 9­Item Scale (PHQ­9; Kroenke, Spitzer, Wil­liams, & Löwe, 2010) was used to assess symptoms of depression.

Any idea how I'd go about doing it?

Edit: Since I am very new to this stuff I don't know if it's valuable information but I'll drop this here as well:

bibliography      : ["r-references.bib", "library.bib"]
documentclass     : "apa6"

Edit: I tried to search around for a solution and the only thing I found was this thread which more or less has the same question. Asked about 1 & 1/2 year ago and no answers.


Solution

  • For me it works with this format:

    [PHQ-9; @Kroenke2010] was used to assess symptoms
    

    You can read more about pandoc-citeproc formatting here: https://pandoc.org/MANUAL.html#citations.