[R] Understanding the workflow between sweave, R and Latex

syrvn mentor_ at gmx.net
Fri Sep 30 14:03:55 CEST 2011

Let's say I have written the following tiny .Rnw file:











I then can go to R and use sweave to translate the .Rnw file into a .tex

Once this is done the latex interpreter can be called and because I used

\usepackage{Sweave} Latex knows how to handle the sweave specific code tags.

When I first did this procedure I got the commong error that the Sweave.sty
file could

not be found. I googled and could solve the problem by typing the following

into the Mac OS Terminal:

mkdir -p ~/Library/texmf/tex/latex

cd ~/Library/texmf/tex/latex

ln -s /Library/Frameworks/R.framework/Resources/share/texmf Sweave

What I don't understand now is how does the latex package
\usepackage{Sweave} know that it

has to look at ~/Library/texmf/tex/latex to find the symbolic link to the
Sweave.sty file?

What happens if I change the following line:

ln -s /Library/Frameworks/R.framework/Resources/share/texmf Sweave


ln -s /Library/Frameworks/R.framework/Resources/share/texmf Sweave_Link

In the .Rnw file do I have to use then \usepackage{Sweave_Link}?

Best regards,


View this message in context: http://r.789695.n4.nabble.com/Understanding-the-workflow-between-sweave-R-and-Latex-tp3859612p3859612.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list