I'm trying to italicise a scientific name when converting a .Rnw file to a .tex file using knitr. I'm getting an error when running knit
. This is my code contained within my .Rnw file (needs taxize
and stringr
libraries to run):
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum \Sexpr{str_c("Collared Flycatchers (\\textit{", comm2sci(commnames='Collared Flycatcher', db="itis")[[1]], "})")[1]}
The output in the .tex file should be:
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Collared Flycatchers (\textit{Ficedula semitorquata})
How can I get this output in the .tex file?