I am trying to learn the basics of Sweave so I read some things and a friend gave me his Rnw file to play with. I am able to do R CMD Sweave mark-example.Rnw. That works. But, then when I do latex mark-example.tex, I get the message below. I looked in the archives and Martin Morgan mentioned something in 2004 in terms of making sure that latex is looking at where Sweave.sty is but I am unsure of how to do that. In fact, I don't even know where Sweave.sty is. Thanks for your help. ! LaTeX Error: File `Sweave.sty' not found. the command \usepackage{Sweave} is in my tex file.
In my original message, I forot to include my Session Info so it is below. I apologize for that. sessionInfo() R version 2.8.0 (2008-10-20) i386-redhat-linux-gnu locale: LC_CTYPE=en_US.utf8;LC_NUMERIC=C;LC_TIME=en_US.utf8;LC_COLLATE=en_US.utf8;LC_MONETARY=C;LC_MESSAGES=en_US.utf8;LC_PAPER=en_US.utf8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.utf8;LC_IDENTIFICATION=C On Mon, Jan 12, 2009 at 10:59 PM, markleeds at verizon.net wrote:> I am trying to learn the basics of Sweave so I read some things and a > friend gave me his Rnw file > to play with. I am able to do R CMD Sweave mark-example.Rnw. That > works. But, > then when I do latex mark-example.tex, I get the message below. I > looked in the archives > and Martin Morgan mentioned something in 2004 in terms of making sure > that latex is > looking at where Sweave.sty is but I am unsure of how to do that. In > fact, I don't even know > where Sweave.sty is. Thanks for your help. > > ! LaTeX Error: File `Sweave.sty' not found. > > the command \usepackage{Sweave} is in my tex file. > > ______________________________________________ > R-help at 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.
"Sweave.sty" is in the directory file.path(R.home(), 'share', 'texmf') Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Tue, Jan 13, 2009 at 11:59 AM, <markleeds at verizon.net> wrote:> I am trying to learn the basics of Sweave so I read some things and a friend > gave me his Rnw file > to play with. I am able to do R CMD Sweave mark-example.Rnw. That works. > But, > then when I do latex mark-example.tex, I get the message below. I looked in > the archives > and Martin Morgan mentioned something in 2004 in terms of making sure that > latex is > looking at where Sweave.sty is but I am unsure of how to do that. In fact, I > don't even know > where Sweave.sty is. Thanks for your help. > > ! LaTeX Error: File `Sweave.sty' not found. > > the command \usepackage{Sweave} is in my tex file. > > ______________________________________________ > R-help at 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. >
Martin Morgan kindly explained to me off-list that I need to use R CMD pdflatex mark-example.tex. That fixed my problem. On Mon, Jan 12, 2009 at 11:25 PM, markleeds at verizon.net wrote:> In my original message, I forot to include my Session Info so it is > below. I apologize for that. > > sessionInfo() > R version 2.8.0 (2008-10-20) > i386-redhat-linux-gnu > > locale: > > > LC_CTYPE=en_US.utf8;LC_NUMERIC=C;LC_TIME=en_US.utf8;LC_COLLATE=en_US.utf8;LC_MONETARY=C;LC_MESSAGES=en_US.utf8;LC_PAPER=en_US.utf8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.utf8;LC_IDENTIFICATION=C > > > On Mon, Jan 12, 2009 at 10:59 PM, markleeds at verizon.net wrote: > >> I am trying to learn the basics of Sweave so I read some things and a >> friend gave me his Rnw file >> to play with. I am able to do R CMD Sweave mark-example.Rnw. That >> works. But, >> then when I do latex mark-example.tex, I get the message below. I >> looked in the archives >> and Martin Morgan mentioned something in 2004 in terms of making sure >> that latex is >> looking at where Sweave.sty is but I am unsure of how to do that. In >> fact, I don't even know >> where Sweave.sty is. Thanks for your help. >> >> ! LaTeX Error: File `Sweave.sty' not found. >> >> the command \usepackage{Sweave} is in my tex file. >> >> ______________________________________________ >> R-help at 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. > > ______________________________________________ > R-help at 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.
This doesn't address your original question, but you might want to look at using the Sweash.sh script available from http://lib.stat.cmu.edu/R/CRAN/contrib/extra/scripts/. Download the file, move it to /usr/local/bin (e.g., mv Sweave.sh /usr/local/bin) and make sure it's executable (chmod +x /usr/local/bin/Sweave.sh). Now you can create a .pdf from your .Rnw file in a single run, using Sweave.sh -ld PathToFile.Rnw. -Ista From: markleeds@verizon.net To: r-help@stat.math.ethz.ch Date: Mon, 12 Jan 2009 21:59:17 -0600 (CST) Subject: [R] basic sweave question I am trying to learn the basics of Sweave so I read some things and a friend gave me his Rnw file to play with. I am able to do R CMD Sweave mark-example.Rnw. That works. But, then when I do latex mark-example.tex, I get the message below. I looked in the archives and Martin Morgan mentioned something in 2004 in terms of making sure that latex is looking at where Sweave.sty is but I am unsure of how to do that. In fact, I don't even know where Sweave.sty is. Thanks for your help. ! LaTeX Error: File `Sweave.sty' not found. the command \usepackage{Sweave} is in my tex file. [[alternative HTML version deleted]]
The pdflatex is the an excutable programe located in your MiKTex‘ bin folder, I guess you have not add your MikTex bin folder into your Windows PATH environment On Thu, Mar 14, 2013 at 12:55 AM, susieboyce [via R] < ml-node+s789695n4661220h61@n4.nabble.com> wrote:> I have located my Sweave.sty in my R program files and I've tried copying > and pasting this into many folders in the C/.../MiKTeX/tex/latex > environment, including making a new folder called 'Sweave' and storing in > here and still my .tex file gives me an error when I try to compile it. > > What is this pdflatex? Is it an R command? If so, what package is it in? > > Where does this go? In the original .rnw file, do you type this into R or > somewhere else?: > pdflatex --include-directory="C:\Program > Files\R\R-2.14.0\share\texmf\tex\latex" your_tex.tex > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://r.789695.n4.nabble.com/basic-sweave-question-tp876734p4661220.html > To unsubscribe from basic sweave question, click here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=876734&code=bGdoMDUwNEBnbWFpbC5jb218ODc2NzM0fC0xODczMTIwODc1> > . > NAML<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >-- View this message in context: http://r.789695.n4.nabble.com/basic-sweave-question-tp876734p4662100.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]
you are welcome! On Thu, Mar 14, 2013 at 6:01 PM, susieboyce [via R] < ml-node+s789695n4661296h17@n4.nabble.com> wrote:> Thank you for your reply. I have found the pdflatex file. I was able to > solve my 'Sweave.sty not found' error by coping the Sweave.sty file and > pasting it into the working directory for the LaTeX file. > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://r.789695.n4.nabble.com/basic-sweave-question-tp876734p4661296.html > To unsubscribe from basic sweave question, click here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=876734&code=bGdoMDUwNEBnbWFpbC5jb218ODc2NzM0fC0xODczMTIwODc1> > . > NAML<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> >-- View this message in context: http://r.789695.n4.nabble.com/basic-sweave-question-tp876734p4662102.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]