Skip to content

Commit 430a149

Browse files
committed
Enable preview of vignettes in RStudio
Make a few changes to make the 'Compile PDF' button work for Rcpp vignettes in RStudio: - Set Sweave as the default Rnw processor in RStudio project file - Magic comment to specify highlight package as the Sweave driver (note this is only recognized by development versions of RStudio >= v0.99.258) - Turn off Sweave concordance (enabling it produced errors, not sure why) - Add artifacts of PDF preview to .gitignore for vignettes directory
1 parent fb697c9 commit 430a149

11 files changed

+27
-1
lines changed

Rcpp.Rproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ UseSpacesForTab: Yes
99
NumSpacesForTab: 4
1010
Encoding: UTF-8
1111

12-
RnwWeave: knitr
12+
RnwWeave: Sweave
1313
LaTeX: pdfLaTeX
1414

1515
AutoAppendNewline: Yes

vignettes/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Rcpp-*.bbl
2+
Rcpp-*.log
3+
Rcpp-*.tex
4+
Rcpp-*.pdf
5+
unitTests-results/

vignettes/Rcpp-FAQ.Rnw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
% !Rnw driver = highlight::HighlightWeaveLatex()
12
\documentclass[10pt]{article}
23
%\VignetteIndexEntry{Rcpp-FAQ}
34
%\VignetteEngine{highlight::highlight}
45
%\VignetteKeywords{Rcpp, FAQ}
56
%\VignetteDepends{Rcpp}
7+
\SweaveOpts{concordance=FALSE}
8+
69
\usepackage[USletter]{vmargin}
710
\setmargrb{0.75in}{0.75in}{0.75in}{0.75in}
811

vignettes/Rcpp-attributes.Rnw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
% !Rnw driver = highlight::HighlightWeaveLatex()
12
\documentclass[11pt]{article}
23
%\VignetteIndexEntry{Rcpp-attributes}
34
%\VignetteEngine{highlight::highlight}
45
%\VignetteKeywords{Rcpp, attributes}
56
%\VignetteDepends{Rcpp}
7+
\SweaveOpts{concordance=FALSE}
8+
69
\usepackage[USletter]{vmargin}
710
\setmargrb{1.25in}{1.25in}{1.25in}{1.25in}
811

vignettes/Rcpp-extending.Rnw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
% !Rnw driver = highlight::HighlightWeaveLatex()
12
\documentclass[10pt]{article}
23
%\VignetteIndexEntry{Rcpp-extending}
34
%\VignetteEngine{highlight::highlight}
45
%\VignetteKeywords{Rcpp, package}
56
%\VignetteDepends{Rcpp}
7+
\SweaveOpts{concordance=FALSE}
8+
69
\usepackage[USletter]{vmargin}
710
\setmargrb{0.75in}{0.75in}{0.75in}{0.75in}
811

vignettes/Rcpp-introduction.Rnw

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
% !Rnw driver = highlight::HighlightWeaveLatex()
12
%% use JSS class -- use 'nojss' to turn off header
23
\documentclass[shortnames,nojss,article]{jss}
34
\usepackage{booktabs,flafter,thumbpdf}
45
%\VignetteIndexEntry{Rcpp-introduction}
56
%\VignetteKeywords{Rcpp, foreign function interface, .Call, C++, R}
67
%\VignetteDepends{Rcpp}
8+
\SweaveOpts{concordance=FALSE}
79

810
\author{Dirk Eddelbuettel\\Debian Project \And Romain Fran\c{c}ois\\\proglang{R} Enthusiasts}
911
\Plainauthor{Dirk Eddelbuettel, Romain Fran\c{c}ois}

vignettes/Rcpp-modules.Rnw

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
% !Rnw driver = highlight::HighlightWeaveLatex()
12
\documentclass[10pt]{article}
23
%\VignetteIndexEntry{Rcpp-modules}
34
%\VignetteEngine{highlight::highlight}
45
%\VignetteKeywords{Rcpp, module}
56
%\VignetteDepends{Rcpp}
7+
\SweaveOpts{concordance=FALSE}
68

79
\usepackage[USletter]{vmargin}
810
\setmargrb{0.75in}{0.75in}{0.75in}{0.75in}

vignettes/Rcpp-package.Rnw

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
% !Rnw driver = highlight::HighlightWeaveLatex()
12
\documentclass[10pt]{article}
23
%\VignetteIndexEntry{Rcpp-package}
34
%\VignetteEngine{highlight::highlight}
45
%\VignetteKeywords{Rcpp, package}
56
%\VignetteDepends{Rcpp}
7+
\SweaveOpts{concordance=FALSE}
68

79
\usepackage[USletter]{vmargin}
810
\setmargrb{0.75in}{0.75in}{0.75in}{0.75in}

vignettes/Rcpp-quickref.Rnw

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
% !Rnw driver = highlight::HighlightWeaveLatex()
12
\documentclass[8pt,twocolumn,a4paper]{article}
23
%\VignetteIndexEntry{Rcpp-quickref}
34
%\VignetteEngine{highlight::highlight}
45
%\VignetteKeywords{Rcpp, reference}
56
%\VignetteDepends{Rcpp}
7+
\SweaveOpts{concordance=FALSE}
68

79
\setlength{\hoffset}{-0.8in}
810
\setlength{\voffset}{-0.8in}

vignettes/Rcpp-sugar.Rnw

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
% !Rnw driver = highlight::HighlightWeaveLatex()
12
\documentclass[10pt]{article}
23
%\VignetteIndexEntry{Rcpp-sugar}
34
%\VignetteEngine{highlight::highlight}
45
%\VignetteKeywords{Rcpp, syntactic sugar}
56
%\VignetteDepends{Rcpp}
7+
\SweaveOpts{concordance=FALSE}
68

79
\usepackage[USletter]{vmargin}
810
\setmargrb{0.75in}{0.75in}{0.75in}{0.75in}

0 commit comments

Comments
 (0)