I am writing a manuscript using RMarkdown and one issue with in-text citations I haven't been able to figure out is when I have a prefix (or suffix) along with the citation. See the following text for example:
(around 0.07% of the global population, Worldometer 2022)
This can be produced using the following code:
[around 0.07% of the global population, @worldometer2022]
However, in such instances, the prefix should ideally be separated from the rest of the citation by a semi-colon and not a comma. Doing so in the code completely messes up the knitted text:
[around 0.07% of the global population; @worldometer2022]
[around 0.07% of the global population; Worldometer (2022)]
From a different SO post, I realised that this is because Pandoc reads that semi-colon as something else and it therefore needs to be "escaped" using a backslash. However, when I try that, the backlash seems to automatically disappear or be removed each time I save/knit, and I get the same messy text.
Can anyone help me with this? Why is the "escaping" not working? Is there a more efficient way of having semi-colons in the prefix? It's quite an essential feature, as commas are not appropriate everywhere.
Here's my YAML:
---
title: "Test"
author: "A"
bibliography: mybib.bib
csl: ibis.csl # but semi-colon problem occurs even with default csl
link-citations: yes
output:
bookdown::word_document2:
number_sections: true
global_numbering: true
fig_caption: yes
reference_docx: rmd_word_template.docx
---
where mybib.bib
is:
@misc{worldometer2022,
title = {{{COVID Live}} - {{Coronavirus Statistics}} - {{Worldometer}}},
author = {{Worldometer}},
year = {2022},
month = jan,
abstract = {Live statistics and coronavirus news tracking the number of confirmed cases, recovered patients, tests, and death toll due to the COVID-19 coronavirus from Wuhan, China. Coronavirus counter with new cases, deaths, and number of tests per 1 Million population. Historical data and info. Daily charts, graphs, news and updates},
howpublished = {https://www.worldometers.info/coronavirus/},
}