How to convert text within R markdown chunk to italic when knitting to PDF

604 Views Asked by At

I am trying to convert text within Rmarkdown chunk to italic such that italic appears in PDF after knitting.

So let's say I have for example the following chunk:

```{r}
"I want this text to be in italic when knitting"
                ```

How do I make the text appear in italic in PDF?

1

There are 1 best solutions below

0
manro On

You can try LaTeX-solution:

Choose xelatex engine:

output:
  pdf_document:
    latex_engine: xelatex

Italic, Bold and Combined:

\textit{I want this text to be in italic when knitting}

\textbf{I want this text to be in italic when knitting}

\textbf{\textit{I want this text to be in italic when knitting}}

enter image description here