highr v0.8


Monthly downloads



Syntax Highlighting for R Source Code

Provides syntax highlighting for R source code. Currently it supports LaTeX and HTML output. Source code of other languages is supported via Andre Simon's highlight package (<http://www.andre-simon.de>).



Build Status Downloads from the RStudio CRAN mirror

This is an infrastructure R package for syntax highlighting. It supports LaTeX and HTML output. Not surprisingly, it works best with R code. It attaches markups onto source code, e.g., it turns

a <- 1 # something

into LaTeX code

\hlstd{a} \hlkwb{<-} \hlnum{1} \hlcom{\# something}

or HTML code

<span class="hl std">a</span> <span class="hl kwb">&lt;-</span> <span class="hl num">1</span> <span class="hl com"># something</span>


hi_latex("a <- 1 # something")
hi_html("a <- 1 # something")
# or hilight(code, format = "latex"/"html")

This package also has a wrapper function, hi_andre(), for Andre Simon's Highlight package.

There are a few package Markdown vignettes in this package:

browseVignettes(package = "highr")

To install the development version here, use

install.packages('highr', repos = 'http://rforge.net', type = 'source')

This package is licensed under GPL, and is supposed to serve other packages such as knitr.

Functions in highr

Name Description
hilight Syntax highlight an R code fragment
hi_andre A wrapper to Andre Simon's Highlight
No Results!

Vignettes of highr

No Results!

Last month downloads


Type Package
License GPL
URL https://github.com/yihui/highr
BugReports https://github.com/yihui/highr/issues
VignetteBuilder knitr
RoxygenNote 6.0.1
NeedsCompilation no
Packaged 2019-03-20 18:58:08 UTC; yihui
Repository CRAN
Date/Publication 2019-03-20 21:10:33 UTC

Include our badge in your README