[Rcpp-commits] r1624 - in pkg/Rcpp/inst/doc: . Rcpp-sugar

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 19 13:08:31 CEST 2010


Author: romain
Date: 2010-06-19 13:08:30 +0200 (Sat, 19 Jun 2010)
New Revision: 1624

Added:
   pkg/Rcpp/inst/doc/Rcpp-sugar.Rnw
   pkg/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar-fake.Rnw
   pkg/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar.Rnw
Modified:
   pkg/Rcpp/inst/doc/Makefile
Log:
vignette skeleton

Modified: pkg/Rcpp/inst/doc/Makefile
===================================================================
--- pkg/Rcpp/inst/doc/Makefile	2010-06-19 11:03:03 UTC (rev 1623)
+++ pkg/Rcpp/inst/doc/Makefile	2010-06-19 11:08:30 UTC (rev 1624)
@@ -8,15 +8,17 @@
 ## on Ubuntu so for Dirk will insist on pdflatex and this variable helps
 whoami=$(shell whoami)
 
-all: clean index.html Rcpp-unitTests.pdf Rcpp-introduction.pdf Rcpp-modules.pdf Rcpp-package.pdf Rcpp-FAQ.pdf Rcpp-extending.pdf
+all: clean index.html Rcpp-unitTests.pdf Rcpp-introduction.pdf Rcpp-modules.pdf Rcpp-package.pdf Rcpp-FAQ.pdf Rcpp-extending.pdf Rcpp-sugar.pdf
 
 clean:
 	touch Rcpp-unitTests.pdf
+	touch Rcpp-sugar.pdf
 	touch Rcpp-introduction.pdf
 	touch Rcpp-modules.pdf
 	touch Rcpp-FAQ.pdf
 	touch Rcpp-extending.pdf
 	rm Rcpp-introduction.pdf
+	rm Rcpp-sugar.pdf
 	rm Rcpp-unitTests.pdf
 	rm Rcpp-modules.pdf
 	rm Rcpp-FAQ.pdf
@@ -127,4 +129,25 @@
 	rm -fr Rcpp-extending.log
 	rm Rcpp-extending.Rnw
 	cp Rcpp-extending/Rcpp-extending-fake.Rnw Rcpp-extending.Rnw
+
+Rcpp-sugar.pdf : Rcpp-sugar/Rcpp-sugar.Rnw
+	rm Rcpp-sugar.Rnw
+	cp -f Rcpp-sugar/Rcpp-sugar.Rnw .
+	Rscript -e "require(highlight); driver <- HighlightWeaveLatex(boxes = TRUE, bg = 'white' ); Sweave( 'Rcpp-sugar.Rnw', driver = driver ); "
+	Rscript -e "tools::texi2dvi( 'Rcpp-sugar.tex', pdf = TRUE, clean = FALSE )"
+	bibtex Rcpp-sugar
+ifeq ($(whoami),edd)
+	pdflatex Rcpp-sugar
+	pdflatex Rcpp-sugar
+else
+	Rscript -e "tools::texi2dvi( 'Rcpp-sugar.tex', pdf = TRUE, clean = TRUE )"
+endif
+	rm -fr Rcpp-sugar.tex
+	rm -fr Rcpp-sugar.bbl
+	rm -fr Rcpp-sugar.blg
+	rm -fr Rcpp-sugar.aux
+	rm -fr Rcpp-sugar.out
+	rm -fr Rcpp-sugar.log
+	rm Rcpp-sugar.Rnw
+	cp Rcpp-sugar/Rcpp-sugar-fake.Rnw Rcpp-sugar.Rnw
 	

Added: pkg/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar-fake.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar-fake.Rnw	                        (rev 0)
+++ pkg/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar-fake.Rnw	2010-06-19 11:08:30 UTC (rev 1624)
@@ -0,0 +1,4 @@
+\documentclass[10pt]{article}
+%\VignetteIndexEntry{Rcpp-sugar}
+\begin{document}
+\end{document}

Added: pkg/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar.Rnw	                        (rev 0)
+++ pkg/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar.Rnw	2010-06-19 11:08:30 UTC (rev 1624)
@@ -0,0 +1,60 @@
+\documentclass[10pt]{article}
+%\VignetteIndexEntry{Rcpp-sugar}
+\usepackage{vmargin}
+\setmargrb{0.75in}{0.75in}{0.75in}{0.75in}
+
+\usepackage{color, alltt}
+\usepackage[authoryear,round,longnamesfirst]{natbib}
+\usepackage[colorlinks]{hyperref}
+\definecolor{link}{rgb}{0,0,0.3}	%% next few lines courtesy of RJournal.sty
+\hypersetup{
+    colorlinks,%
+    citecolor=link,%
+    filecolor=link,%
+    linkcolor=link,%
+    urlcolor=link
+}
+
+\newcommand{\proglang}[1]{\textsf{#1}}
+\newcommand{\pkg}[1]{{\fontseries{b}\selectfont #1}}
+
+\author{Dirk Eddelbuettel \and Romain Fran\c{c}ois}
+\title{\pkg{Rcpp} syntactic sugar}
+
+<<echo=FALSE>>=
+link <- function( f, package, text = f, root = "http://finzi.psych.upenn.edu/R/library/" ){
+	h <- if( missing(package) ) {
+		as.character( help( f ) )
+	} else {
+		as.character( help( f, package = paste( package, sep = "" ) ) )
+	}
+	if( ! length(h) ){
+		sprintf( "\\\\textbf{%s}", f )
+	} else {
+		rx <- "^.*/([^/]*?)/help/(.*?)$"
+		package <- sub( rx, "\\1", h, perl = TRUE )
+		page <- sub( rx, "\\2", h, perl = TRUE )
+		sprintf( "\\\\href{%s%s/html/%s.html}{\\\\texttt{%s}}", root, package, page, text )
+	}
+}
+linkS4class <- function( cl, package, text = cl, root = "http://finzi.psych.upenn.edu/R/library/" ){
+	link( sprintf("%s-class", cl), package, text, root )
+}
+@
+
+\begin{document}
+\maketitle
+
+\abstract{
+  \noindent
+  Since version 0.8.3, \pkg{Rcpp}\cite{CRAN:Rcpp} defines syntactic sugar that allows
+  usage of a subset of the \proglang{R} syntax in \proglang{C++} code. 
+  
+  \pkg{Rcpp::sugar} is based on the technique of expression templates.
+}
+
+\bibliographystyle{abbrvnat}
+\bibliography{Rcpp}
+
+\end{document}
+

Added: pkg/Rcpp/inst/doc/Rcpp-sugar.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-sugar.Rnw	                        (rev 0)
+++ pkg/Rcpp/inst/doc/Rcpp-sugar.Rnw	2010-06-19 11:08:30 UTC (rev 1624)
@@ -0,0 +1,4 @@
+\documentclass[10pt]{article}
+%\VignetteIndexEntry{Rcpp-sugar}
+\begin{document}
+\end{document}



More information about the Rcpp-commits mailing list