How can I make a text appear like code in Rmarkdown output? Like this: text formatted as code
?
Putting my text between backticks is not producing this effect (like it has done above). Instead text is being formated verbatim.
Thanks
How can I make a text appear like code in Rmarkdown output? Like this: text formatted as code
?
Putting my text between backticks is not producing this effect (like it has done above). Instead text is being formated verbatim.
Thanks
It seems the backsticks are not working for pdf output (https://community.rstudio.com/t/highlighting-text-inline-in-rmarkdown-or-bookdown-pdf/35118/4).
I was able to solve this by using the soul
and xcolor
packages and by incluind the following line in my header:
\usepackage{soul, xcolor}
\definecolor{codegray}{rgb}{0.95,0.95,0.95}
\sethlcolor{codegray}
Now I can use the tag hl{text}
to produce the desired result. Although I still have to switch all my backticks by this tag in my document.