5

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?

3
  • 3
    Have a look at knit_theme
    – mnel
    Feb 21, 2014 at 0:46
  • 1
    (1) it would probably be better to give the answer as an answer to your own question, rather than editing your question; (2) [a comment on your closed "why do I get low resolution" question, which I can't leave there]: feel free to edit (undelete/ask a new question) with more information rather than closing -- if it turns out that this is a commonly encountered situation, the answers could be helpful to future readers as well as to yourself. I suspect you're sending your output to a PNG file with relatively low resolution, but I can't tell without more information.
    – Ben Bolker
    Jun 18, 2014 at 17:16
  • Thanks @BenBolker , I've done as you suggested. I'll post my other question soon.
    – N4v
    Jun 18, 2014 at 17:52

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.