From 98d7298fbdb3bd6eff125cfee54b673cdc98c5c4 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 1 Sep 2014 00:17:13 -0500 Subject: [PATCH] the syntax highlighter has been moved to highr --- inst/examples/knitr-manual.Rnw | 28 ++++++++++++++-------------- inst/examples/knitr-manual.lyx | 16 ++++++++++++++-- inst/examples/knitr-packages.bib | 7 +++++++ 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/inst/examples/knitr-manual.Rnw b/inst/examples/knitr-manual.Rnw index 08772e7890..5b908a9e97 100644 --- a/inst/examples/knitr-manual.Rnw +++ b/inst/examples/knitr-manual.Rnw @@ -209,19 +209,19 @@ dedicated to specific features such as graphics in the website: \url{http://yihu \subsection{Code Decoration} -An internal syntax highlighter is used to highlight R code, and the -\textbf{formatR} package \citep{R-formatR} is used to reformat R -code (like \texttt{keep.source=FALSE} in Sweave but will also try -to retain comments). For \LaTeX{} output, the \textbf{framed} package -is used to decorate code chunks with a light gray background. If this -\LaTeX{} package is not found in the system, a version will be copied -directly from \textbf{knitr}. The prompt characters are removed by -default because they mangle the R source code in the output and make -it difficult to copy R code. The R output is masked in comments by -default based on the same rationale. It is easy to revert to the output -with prompts (set option \texttt{prompt=TRUE}), and you will quickly -realize the inconvenience to the readers if they want to copy and -run the code in the output document: +The \textbf{highr} package \citep{R-highr} is used to highlight R +code, and the \textbf{formatR} package \citep{R-formatR} is used +to reformat R code (like \texttt{keep.source=FALSE} in Sweave but +will also try to retain comments). For \LaTeX{} output, the \textbf{framed} +package is used to decorate code chunks with a light gray background. +If this \LaTeX{} package is not found in the system, a version will +be copied directly from \textbf{knitr}. The prompt characters are +removed by default because they mangle the R source code in the output +and make it difficult to copy R code. The R output is masked in comments +by default based on the same rationale. It is easy to revert to the +output with prompts (set option \texttt{prompt=TRUE}), and you will +quickly realize the inconvenience to the readers if they want to copy +and run the code in the output document: <>= x=rnorm(5) @@ -706,7 +706,7 @@ and questions can be delivered to the \href{mailto:knitr@googlegroups.com}{maili % when knitr is updated, this chunk will be updated; why? <>= # write all packages in the current session to a bib file -write_bib(c(.packages(), 'evaluate', 'formatR'), file = 'knitr-packages.bib') +write_bib(c(.packages(), 'evaluate', 'formatR', 'highr'), file = 'knitr-packages.bib') @ \bibliographystyle{jss} diff --git a/inst/examples/knitr-manual.lyx b/inst/examples/knitr-manual.lyx index 46052ce850..cd5ee9e14c 100644 --- a/inst/examples/knitr-manual.lyx +++ b/inst/examples/knitr-manual.lyx @@ -813,7 +813,18 @@ Code Decoration \end_layout \begin_layout Standard -An internal syntax highlighter is used to highlight R code, and the +The +\series bold +highr +\series default + package +\begin_inset CommandInset citation +LatexCommand citep +key "R-highr" + +\end_inset + + is used to highlight R code, and the \series bold formatR \series default @@ -2932,7 +2943,8 @@ SE, warning=FALSE>>= \begin_layout Plain Layout -write_bib(c(.packages(), 'evaluate', 'formatR'), file = 'knitr-packages.bib') +write_bib(c(.packages(), 'evaluate', 'formatR', 'highr'), file = 'knitr-packages.b +ib') \end_layout \begin_layout Plain Layout diff --git a/inst/examples/knitr-packages.bib b/inst/examples/knitr-packages.bib index fd0afe0772..0b87e07632 100644 --- a/inst/examples/knitr-packages.bib +++ b/inst/examples/knitr-packages.bib @@ -49,6 +49,13 @@ @Manual{R-ggplot2 url = {http://ggplot2.org, https://github.com/hadley/ggplot2}, year = {2014}, } +@Manual{R-highr, + title = {highr: Syntax highlighting for R}, + author = {Yihui Xie and Yixuan Qiu}, + year = {2013}, + note = {R package version 0.3}, + url = {http://CRAN.R-project.org/package=highr}, +} @Manual{R-knitr, title = {knitr: A general-purpose package for dynamic report generation in R}, author = {Yihui Xie},