There appears to be a small bug in rendering backticks to PDFs in R Markdown. This mostly only matters when trying to show how to write R Markdown. The bug is that backticks show as single quotes instead.
I am copy-and-pasting the code, as pushing the reprex button in RStudio didn't work. (I'm sure there's a way around that, but it doesn't seem necessary here.)
The website is only allowing one picture to be pasted in, so I will paste in a picture of the beginning of the pdf.
Unfortunately, reproducing backticks doesn't work well here. There are some missing even though I have marked the paste as code. So I am also uploading a picture.
I can't upload .RMD or .pdf files, but I am happy to provide them if it would be helpful.
If it matters, I am running on Windows 10 with the most recent version of R and RStudio as well as all packages up-to-date as of yesterday.
There is an option somewhere that show the backticks in this font. @yihui do you remember what could cause the backtick to be shown this way in LaTeX ?
I know this could happen with quotation mark and smart extension but I can't remember for this case.
Also @startz can you share xfun::session_info("rmarkdown") ? thanks
Could you also provide xfun::session_info('tinytex')? My current guess is that your LaTeX installation doesn't have the upquote package. If you are using TinyTeX as your LaTeX distribution, you may run tinytex::tlmgr_install('upquote').
I tend to agree. This is where to add LaTeX package names to the default TinyTeX bundle: tinytex/tools/pkgs-custom.txt at main · rstudio/tinytex · GitHub The upquote package is relatively small in size, so it won't hurt much. However, I'm not sure how frequently users could run into this problem. You are the first one who has reported this problem over the last few years. I guess an average user is unlikely to output backticks verbatim, but I know that this is very useful for writing tutorials to teach R Markdown. Perhaps I'll wait for a longer time and see if anyone else will be affected by this problem in the future. Thanks for the suggestion!
Thanks @yihui ! I learnt about this one.
It is hidden in the Pandoc Manual :
The following packages will be used to improve output quality if present, but pandoc does not require them to be present: upquote (for straight quotes in verbatim environments)
Using a clean TinyTeX installation, I can reproduce this. I'll try that next time!
Thank you