Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Comment Font in knitr

Tags:

r

knitr

In the official knitr manual, comments are in green and they are upright as opposed to italic. But whenever I use knitr to compile a PDF, my comments are purple and italic. How can I change this?

like image 234
N4v Avatar asked Oct 21 '22 14:10

N4v


1 Answers

Answering my own question:

Thanks to mnel for the tip. Just use knit_theme: you use the knit_theme command within the R Sweave document, similar to the way in which you put in code chunks.

E.g.:

\documentclass[12pt,a4paper,final]{article}    # Setting document class

<<adjust-preamble, include=FALSE>>=            # Using knit_theme
knit_theme$set("seashell")
@

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{savetrees}

\begin{document}

etc.
like image 75
N4v Avatar answered Oct 27 '22 08:10

N4v