I am using bookdown to generate a pdf book, and use a .bib file generated with mendeley. I use the natbib package with \setcitestyle{numbers,square} style. I call the references with [@reference].

I have quite a few references with species names in the title, something like this:

Incidence of mutator strains in Escherichia coli and coliforms in nature. Mutation Research Letters, 91(2):107–110, mar 1981

Where Escherichia coli is the species name. By default, it is not italicized. Initially, I tried to add <i>Escherichia coli</i> inside the reference title, but this does not seem to work when used in bookdown. Is there any way to make sure that these names are italicized in the reference list?

  • If this were a LaTeX question \emph{Escherichia coli} should work, but I'm not sure if and where bookdown uses LaTeX (syntax) and whether the bibliography is passed through LaTeX or through some other tool like pandoc citeproc. – moewe Sep 4 '19 at 17:47
  • A few comments: (a) I am not 100% about how on topic this question is for this site, and you may get a better response at github.com/rstudio/bookdown (b) A quick browse of the documentation for bookdown suggests that the workflow goes something like rmarkdown to markdown via knitr, then to latex via pandoc, and then compiled with pdflatex. If that's the case, then you can follow this or this and just wrap the species name in either \textit{} or \emph{}. – Willie Wong Sep 4 '19 at 17:48
  • Thanks for the tip, I tried both, but neither seem to do the trick. The \textit{} or \emph{} is simply rendered as text in the citation – Haakonkas Sep 4 '19 at 18:03
  • Then possibly Bookdown uses pandoc citeproc to deal with the citations. And then this would be (unfortunately) not the right place to ask. Maybe you should ask at superuser.SX or the Bookdown github. – Willie Wong Sep 5 '19 at 2:09

This was fixed by changing reference manager from Mendeley to Zotero. Apparently, mendeley have a lot of escapre-characters in the .bib file that mess things up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.