Note that there are some explanatory texts on larger screens.

plurals
  1. POknitr Markdown highlighting in Emacs?
    primarykey
    data
    text
    <p>Is there any modification of an existing tool or new tool that will syntax-highlight (colour) blocks of R code in a knitr markdown document when opened in Emacs?</p> <p>The knitr chunks I am looking at are triple-backtick blocks <code>[```]</code> that contain R code inside.</p> <p><strong>EDIT:</strong> things that I tried so far:</p> <p><strong><em>- <a href="http://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29" rel="noreferrer">Ubuntu</a> 12.04 with Emacs 23</em></strong></p> <pre class="lang-sh prettyprint-override"><code>emacs --version GNU Emacs 23.3.1 </code></pre> <p><strong>1. Polymode</strong></p> <p><a href="https://github.com/vitoshka/polymode/issues/3" rel="noreferrer">https://github.com/vitoshka/polymode/issues/3</a></p> <p>I am trying to get polymode to syntax-highlight my Rmd files, but it's complaining about a 'color' load file:</p> <pre class="lang-sh prettyprint-override"><code>cd ~/.emacs.d git clone https://github.com/vitoshka/polymode.git </code></pre> <p>In my .emacs file:</p> <pre class="lang-lisp prettyprint-override"><code>(add-to-list 'load-path "/home/avilella/.emacs.d/polymode/") (add-to-list 'load-path "/home/avilella/.emacs.d/polymode/modes/") ;; Require any polymode bundles that you are interested in: (require 'poly-R) (require 'poly-markdown) </code></pre> <p>eval-buffer:</p> <pre class="lang-lisp prettyprint-override"><code>Cannot open load file: color </code></pre> <hr> <p><strong><em>- <a href="http://en.wikipedia.org/wiki/CentOS" rel="noreferrer">CentOS</a> with Emacs 24:</em></strong></p> <pre class="lang-sh prettyprint-override"><code>emacs --version GNU Emacs 24.2.1 </code></pre> <p><strong>1. Polymode installed correctly</strong></p> <p>Open a Rmd file, <code>M-x polymode-minor-mode</code>, no change to the syntax highlighting.</p> <hr> <pre class="lang-sh prettyprint-override"><code>emacs --version GNU Emacs 24.3.1 </code></pre> <p><strong>1. Polymode installed correctly</strong></p> <p>Open a Rmd file, <code>M-x poly-markdown+r-mode</code>, some of the syntax highlighting starts to appear, but I need to manually modify the test in each triple-tick block of code for it to fully show the syntax.</p> <p><img src="https://i.stack.imgur.com/bHbBY.png" alt="Enter image description here"></p> <p><img src="https://i.stack.imgur.com/a6pVA.png" alt="Enter image description here"></p> <p>The second image is just after typing a Return before the knitr block.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload