Hi Liviu,
Right now our main project is to continue debugging and polishing the
tikzDevice. After that has proceeded, Cameron and I are planning to turn our
attention to Sweave.

Right now, the tikzDevice can be used from within Sweave by following a
process similar to:

...

\begin{figure}

<<"bodFig", echo=F>>=

  tikz( "bodFig.tex" )

  model <- nls ( demand ~ BODu * (1 - exp( -k * Time ) ),
    data=BOD,
    start = list(BODu=5,k=0.1)
  )

  plot( demand ~ Time, data = 'BOD' )

  lines( predict( model ), col='red' )

  dev.off()

@

  \input{bodFig}

  \caption{ BOD data along with least squares regression line. }

\end{figure}

The important differences between a norman Sweave figure are that:

  1. You do not put fig=T in the chunk options.

  2. You must execute tikz() within the figure chunk.

  3. You must execute dev.off() when you are done plotting.

  4. You must \include the figure code that gets produced.

Good luck and thanks for giving the package a try!

-Charlie



On Mon, Aug 31, 2009 at 1:19 AM, Liviu Andronic <landronim...@gmail.com>wrote:

> Hello
> And sorry for the brief highjacking.
>
> On 8/31/09, Charlie Sharpsteen <ch...@sharpsteen.net> wrote:
> >  The tikzDevice translates R graphics instructions into a LaTeX-friendly
> >  format that can be included directly into documents where the font used
> in
> >  the figure will match that used in the rest of the text.
> >
> Is there any support for Sweave? What would be the preferred way to
> include TikZ graphics in an Sweave document?
> Thank you
> Liviu
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to