Skip to content

Commit da7f101

Browse files
committed
background boxes are enabled
done by redefining Hchunk as we cannot pass options to the vignette driver, and we cannot wrap the highlight driver in another function as it uses unexported functions :-/
1 parent 6ede6a3 commit da7f101

File tree

7 files changed

+46
-0
lines changed

7 files changed

+46
-0
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2014-01-31 Dirk Eddelbuettel <[email protected]>
2+
3+
* vignettes/Rcpp-FAQ.Rnw: Render code with background boxen
4+
* vignettes/Rcpp-package.Rnw: Idem
5+
* vignettes/Rcpp-modules.Rnw: Idem
6+
* vignettes/Rcpp-extending.Rnw: Idem
7+
* vignettes/Rcpp-sugar.Rnw: Idem
8+
19
2014-01-28 Dirk Eddelbuettel <[email protected]>
210

311
* vignettes/Rcpp-FAQ.Rnw: Some updates for upcoming release

inst/NEWS.Rd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
\item Changes in Rcpp documentation:
3333
\itemize{
3434
\item The Rcpp-FAQ vignette have been updated and expanded.
35+
\item Vignettes are now typeset with grey background for code boxes.
3536
}
3637
}
3738
}

vignettes/Rcpp-FAQ.Rnw

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
\newcommand{\hlboxbacktick}{ \hlnormalsizeboxbacktick}
3535
\newcommand{\hlboxunderscore}{ \hlnormalsizeboxunderscore}
3636

37+
%% This corresponds to setting boxes=TRUE for highlight
38+
\newsavebox{\hlbox}
39+
\definecolor{hlBg}{rgb}{0.949019607843137,0.949019607843137,0.949019607843137}
40+
\definecolor{hlBd}{rgb}{0,0,0}
41+
\renewenvironment{Hchunk}{\vspace{0.5em}\noindent\begin{lrbox}{\hlbox}\begin{minipage}[b]{.9\textwidth}}%
42+
{\end{minipage}\end{lrbox}\fcolorbox{hlBd}{hlBg}{\usebox{\hlbox}}\vspace{0.5em}}
43+
3744
\newcommand{\faq}[1]{FAQ~\ref{#1}}
3845
\newcommand{\rdoc}[2]{\href{http://www.rdocumentation.org/packages/#1/functions/#2}{\code{#2}}}
3946

vignettes/Rcpp-extending.Rnw

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
\newcommand{\hlboxbacktick}{ \hlnormalsizeboxbacktick}
3434
\newcommand{\hlboxunderscore}{ \hlnormalsizeboxunderscore}
3535

36+
%% This corresponds to setting boxes=TRUE for highlight
37+
\newsavebox{\hlbox}
38+
\definecolor{hlBg}{rgb}{0.949019607843137,0.949019607843137,0.949019607843137}
39+
\definecolor{hlBd}{rgb}{0,0,0}
40+
\renewenvironment{Hchunk}{\vspace{0.5em}\noindent\begin{lrbox}{\hlbox}\begin{minipage}[b]{.9\textwidth}}%
41+
{\end{minipage}\end{lrbox}\fcolorbox{hlBd}{hlBg}{\usebox{\hlbox}}\vspace{0.5em}}
42+
3643
<<echo=FALSE,print=FALSE>>=
3744
prettyVersion <- packageDescription("Rcpp")$Version
3845
prettyDate <- format(Sys.Date(), "%B %e, %Y")

vignettes/Rcpp-modules.Rnw

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
\newcommand{\proglang}[1]{\textsf{#1}}
2828
\newcommand{\pkg}[1]{{\fontseries{b}\selectfont #1}}
2929

30+
%% This corresponds to setting boxes=TRUE for highlight
31+
\newsavebox{\hlbox}
32+
\definecolor{hlBg}{rgb}{0.949019607843137,0.949019607843137,0.949019607843137}
33+
\definecolor{hlBd}{rgb}{0,0,0}
34+
\renewenvironment{Hchunk}{\vspace{0.5em}\noindent\begin{lrbox}{\hlbox}\begin{minipage}[b]{.9\textwidth}}%
35+
{\end{minipage}\end{lrbox}\fcolorbox{hlBd}{hlBg}{\usebox{\hlbox}}\vspace{0.5em}}
36+
3037
<<echo=FALSE,print=FALSE>>=
3138
suppressMessages(require(Rcpp))
3239
prettyVersion <- packageDescription("Rcpp")$Version

vignettes/Rcpp-package.Rnw

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
\newcommand{\proglang}[1]{\textsf{#1}}
2727
\newcommand{\pkg}[1]{{\fontseries{b}\selectfont #1}}
2828

29+
%% This corresponds to setting boxes=TRUE for highlight
30+
\newsavebox{\hlbox}
31+
\definecolor{hlBg}{rgb}{0.949019607843137,0.949019607843137,0.949019607843137}
32+
\definecolor{hlBd}{rgb}{0,0,0}
33+
\renewenvironment{Hchunk}{\vspace{0.5em}\noindent\begin{lrbox}{\hlbox}\begin{minipage}[b]{.9\textwidth}}%
34+
{\end{minipage}\end{lrbox}\fcolorbox{hlBd}{hlBg}{\usebox{\hlbox}}\vspace{0.5em}}
35+
2936
<<version,echo=FALSE,print=FALSE>>=
3037
prettyVersion <- packageDescription("Rcpp")$Version
3138
prettyDate <- format(Sys.Date(), "%B %e, %Y")

vignettes/Rcpp-sugar.Rnw

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
\newcommand{\ith}{\textsl{i}-\textsuperscript{th}}
3030
\newcommand{\code}[1]{\texttt{#1}}
3131

32+
33+
%% This corresponds to setting boxes=TRUE for highlight
34+
\newsavebox{\hlbox}
35+
\definecolor{hlBg}{rgb}{0.949019607843137,0.949019607843137,0.949019607843137}
36+
\definecolor{hlBd}{rgb}{0,0,0}
37+
\renewenvironment{Hchunk}{\vspace{0.5em}\noindent\begin{lrbox}{\hlbox}\begin{minipage}[b]{.9\textwidth}}%
38+
{\end{minipage}\end{lrbox}\fcolorbox{hlBd}{hlBg}{\usebox{\hlbox}}\vspace{0.5em}}
39+
40+
3241
<<echo=FALSE,print=FALSE>>=
3342
prettyVersion <- packageDescription("Rcpp")$Version
3443
prettyDate <- format(Sys.Date(), "%B %e, %Y")

0 commit comments

Comments
 (0)