Comments on: Changing Style – knitr and markdown in RStudio http://blogs.cetis.org.uk/adam/2013/10/25/changing-style-knitr-and-markdown-in-rstudio/ Cetis Blogs Wed, 07 Jan 2015 09:19:39 +0000 hourly 1 http://wordpress.org/?v=4.1.22 By: Adam Cooper http://blogs.cetis.org.uk/adam/2013/10/25/changing-style-knitr-and-markdown-in-rstudio/#comment-2604 Tue, 19 Nov 2013 18:35:59 +0000 http://blogs.cetis.org.uk/adam/?p=760#comment-2604 There is a problem with the method described here, and implicit in Yihui’s alternative suggestion. Both make use of the markdown package. The purpose of the content in the .Rprofile file that I gave above is to make RStudio use markdown rather than its own mechanism (derived from the same original code as markdown, I believe).

One of the extensions provided by the Rstudio version is to handle latex style maths equations – e.g. $P(E) = {n \choose k} p^k (1-p)^{n-k}$ – and to produce HTML that uses the MathJax Javascript library to render it in the browser.

This appears to give you a choice: control over style OR nice equation rendering.

A global workaround is to replace the CSS in the RStudio installation. For me on Ubuntu Linux, this is in /usr/lib/rstudio/resources.

I don’t like hacking in the installation directory and it reduces portability. The only other alternative appears to be to insert an HTML style block at the top of each markdown file. Thats a bit ugly too.

Cheers, Adam

]]>
By: Yihui http://blogs.cetis.org.uk/adam/2013/10/25/changing-style-knitr-and-markdown-in-rstudio/#comment-2262 Mon, 28 Oct 2013 20:55:21 +0000 http://blogs.cetis.org.uk/adam/?p=760#comment-2262 You can also take a look at the ‘header’ argument in markdownToHTML(), which is better if you only need to make a slight modification of the CSS, because you will not have to copy the whole markdown.css

]]>