emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Add tikzDevice support to ob-R


From: Rasmus Pank Roulund
Subject: Re: [O] [PATCH] Add tikzDevice support to ob-R
Date: Sun, 27 Nov 2011 12:18:10 +0000
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux)

Aloha Thomas,

> The attached patch adds tikzDevice support to ob-R.  It requires that
> the tikzDevice package be available to R, so it must be installed and
> loaded.  Something like the following code in .Rprofile will load the
> package by default:

Thanks a bunch.  I always use pgfSweave and thus I haven't really
managed to move from Rnw (LaTeX + R files) to Org file.

Are you aware of the very handy pgfsweave bin?  In the Arch R package it
is located in

 /usr/lib/R/bin/pgfsweave

First, you don't have to load tikzDevice. Second, It makes this very
nice notation valid in Rnw files:

#+begin_src latex
\begin{figure}[tbh]
\caption{Time series $x$ and $y$}\label{fig:ts1}
<<ts3xy-plot, echo=FALSE, fig=T, tikz=T, external=T, cache=F, echo=F, width=7, 
height=3, sanitize=T>>=
plot(x.ts)
lines(y.ts)
#abline(lm(y.fil~x.fil))
@
\end{figure}
#+end_latex

which translates to the following automatically:
#+begin_src latex
\begin{figure}[tbh]
\caption{Time series $x$ and $y$}\label{fig:ts1}
\tikzsetnextfilename{class3-ts3xy-plot}
\tikzexternalfiledependsonfile{class3-ts3xy-plot}{class3-ts3xy-plot.tikz}
\input{class3-ts3xy-plot.tikz}
\end{figure}
#+end_src

It also adds nice formatting of R chucks without the need other R
packages.

Thus, using pgfSweave over regular Sweave is just wonderful.  However, I
don't know whether it can integrate with Babel.

Thanks again.

–Rasmus

-- 
Sent from my Emacs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]