'Remove italics (# comments) in Rmarkdown code chunks in pdf

I am looking to find a way to remove the italicized comments in Rmarkdown code chunks

---
output:
  pdf_document:
    keep_tex: true
    number_section: no
---

```{r}
# This is a test.
```

And the results.

enter image description here

Is there a way to make it not italicized?

Thank you,



Solution 1:[1]

Several code highlight styles do not italicize the comments, including haddock, kate, and zenburn. See here for a preview of available styles.

---
output:
  pdf_document:
    keep_tex: true
    number_section: no
    highlight: kate
---

If you need to create a custom syntax highlighting theme, instructions in the pandoc manual are here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Joel Schneider