I see. Thanks for posting the log file. This is a known issue and has been fixed in #7555: http://www.lyx.org/trac/ticket/7555 (right now I don't know when or whether it will be applied to the next version)
The problem comes from the space in the path of your temporary directory, so LaTeX said: ! LaTeX Error: File `C:/Users/Muhammad Yaseen/AppData/Local/Temp/lyx_tmpdir.Hp3 972/lyx_tmpbuf4/sweave_example-007' not found. A temporary fix is to change your temporary directory to another place which does not contain any spaces, e.g. C:\tmp You can do this via the menu Tools-->Preferences-->Paths-->Temporary directory. You need to restart LyX after modifying this setting and make sure the directory exists. Regards, Yihui -- Yihui Xie <xieyi...@gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Fri, May 13, 2011 at 4:42 PM, iftikhar ahmad <ifti_ch2...@yahoo.com> wrote: > Thanks for your response. I am using lyx 2.0.0 on windows and I have used > example "Sweave.lyx" with "article" class. It works well when i exclude the > diagram. But when i include diagram, it produce same error. Also i found a > output file and diagram file in pdf in the temporary directory > "C:\Users\ifti\AppData\Local\Temp\lyx_tmpdir.Hp2076". I think that lyx made > diagram file but problem is in the including of diagram file in output. I am > attaching output file, diagram file and log file. Please have a look. > Regards, > Iftikhar Ahmad > ________________________________ > From: Yihui Xie <x...@yihui.name> > To: iftikhar ahmad <ifti_ch2...@yahoo.com> > Cc: "yx-de...@lists.lyx.org" <yx-de...@lists.lyx.org>; > "lyx-users@lists.lyx.org" <lyx-users@lists.lyx.org> > Sent: Friday, May 13, 2011 7:22 PM > Subject: Re: Error in Lyx Sweave (Noweb) > > Hi, > > You should not use the document class "article (Noweb)". Since LyX > 2.0, you can use the Sweave *module* with any document classes, e.g. > article. > > It seems you are using Windows, so you can take a look at the example > sweave.lyx under the examples directory (somewhere like C:\Program > Files\LyX20\Resources\examples). > > Sweave no longer depends on specific layouts. This is a significant > change in LyX 2.0. > > Regards, > Yihui > -- > Yihui Xie <xieyi...@gmail.com> > Phone: 515-294-2465 Web: http://yihui.name > Department of Statistics, Iowa State University > 2215 Snedecor Hall, Ames, IA > > > > On Thu, May 12, 2011 at 8:21 PM, iftikhar ahmad <ifti_ch2...@yahoo.com> > wrote: >> Hi, >> When I tried to include an R plot with the following code into >> article(Noweb) in LyX 2.0.0 >> >> <<fig=TRUE>>= >> library(graphics) >> pairs(iris) >> @ >> >> I got the following error message: >> >> {C:/Users/MYaseen208/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] >> ! Missing $ inserted. >> <inserted text> >> $ >> l.146 ...ir.Hp5960/lyx_tmpbuf2/sweave_example-007} >> >> I've inserted a begin-math/end-math symbol since I think >> you left one out. Proceed, with fingers crossed. >> ! LaTeX Error: File `C:/Users/MYaseen208/AppData/Local/Temp/lyx_tmpdir.Hp5 >> 960/lyx_tmpbuf2/sweave_example-007' not found. >> >> Any idea to fix this problem. Thanks > > >