Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lyx pgfSweave on mac #5

Closed
floswald opened this issue Dec 17, 2011 · 6 comments
Closed

lyx pgfSweave on mac #5

floswald opened this issue Dec 17, 2011 · 6 comments

Comments

@floswald
Copy link

hi yihui,

in the unlikely case this is still of interest for anybody, I was succesful in hooking up lyx to pgfsweave on my mac. I didnt' get very far with the line for the converter in the preferences file as posted on your blog, i.e.
R -q -e "library(pgfSweave);pgfSweave('yourfile.Rnw')"

this may be specific to my machine, but pgfSweave() failed each single time.

instead i wrote into my lyx preferences:

\converter "literate" "latex" "R CMD pgfsweave -n $$i" ""

and that did the trick. one has to create a link into /Library/Frameworks/R.framework/Resources/bin/pgfsweave from /Library/Frameworks/R.framework/Resources/library/pgfSweave/exec/pgfsweave-script.R
for pgfsweave if not installed from source.

by the way: i was a bit too quick with confirming success on the knitr front: I can just run a standard Sweave output with lyx. something seems not to be working.
looking forward to new developments!

cheers
flo

@yihui
Copy link
Owner

yihui commented Dec 17, 2011

No no, please ignore everything in the web on the configuration of (pgf)Sweave in LyX, including my own blog posts and even the LyX wiki. What I can tell you at the moment are:

  1. Sweave is fairly easy to use in LyX 2.0.2 now; the PDF manual is at https://github.com/downloads/yihui/lyx/sweave.pdf
  2. pgfSweave is not too complicated to configure in LyX if you do not want tikz externalization, but it can be more complicated than you imagined if you do; I have a hackish R script but I do not want to post it;
  3. it is easier for knitr to work with LyX (see the PDF manual and http://yihui.github.com/knitr/demo/lyx/), and knitr has all the features of pgfSweave

@floswald
Copy link
Author

Hi Yihui,
you were right (of course). This works very well with lyx. Two things that were not clear to me:

  1. the sweave module needs to be loaded
  2. but i don't enter R code selecting the "chunk" environment, but plain tex

I kind of missed that in your video.

cheers
flo

@yihui
Copy link
Owner

yihui commented Jan 28, 2012

Both issues have been addressed in the manual: https://github.com/downloads/yihui/lyx/sweave.pdf

The video is outdated somehow. I may do another one after LyX 2.0.3 is released, in which you will see both the Sweave module and the knitr module; I have finally done what I wished to do in LyX.

@floswald
Copy link
Author

that's great! although I have to say I'm more than happy with knitr at the
moment, it's awesome.
cheers

On 28 January 2012 04:24, Yihui Xie <
reply@reply.github.com

wrote:

Both issues have been addressed in the manual:
https://github.com/downloads/yihui/lyx/sweave.pdf

The video is outdated somehow. I may do another one after LyX 2.0.3 is
released, in which you will see both the Sweave module and the knitr
module; I have finally done what I wished to do in LyX.


Reply to this email directly or view it on GitHub:
#5 (comment)

@yihui
Copy link
Owner

yihui commented Feb 29, 2012

Just a quick note: LyX 2.0.3 will be released soon, and knitr will be officially supported there. The announcement has not been made yet, but binaries and sources are already in FTP:

ftp://ftp.lyx.org/pub/lyx/bin/2.0.3/
ftp://ftp.lyx.org/pub/lyx/stable/2.0.3/

see http://yihui.name/knitr/demo/lyx/

@yihui yihui closed this as completed Feb 29, 2012
@floswald
Copy link
Author

i might say this is as good as it gets. thanks for letting me know!

On 29 February 2012 20:28, Yihui Xie <
reply@reply.github.com

wrote:

Just a quick note: LyX 2.0.3 will be released soon, and knitr will be
officially supported there. The announcement has not been made yet, but
binaries and sources are already in FTP:

ftp://ftp.lyx.org/pub/lyx/bin/2.0.3/
ftp://ftp.lyx.org/pub/lyx/stable/2.0.3/

see http://yihui.name/knitr/demo/lyx/


Reply to this email directly or view it on GitHub:
#5 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants