Re: Usinr Sweave / noweb in BEamer presentation
On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnson pauljoh...@gmail.com wrote: Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I wanted to use it for lectures, where it would be very nice to have the code and the result. I've only spent 40 minutes looking at your case. I don't know what a fragile frame is for, but I'll go read more about it. The problem is obviously that you have an error in the latex macros in your layout file. Trying to find where those problems might be is, well, difficult (since I don't see why you care about changing the frame, mainly). Right - so I decided to use a different approach (see attached file BeamerSweaveExample3.lyx) which is working. My question is just: why is Slide 2 working, but Slide 1 or Slide 3 not, when I say echo=TRUE? I don't have a problem usoing ERT boxes, but I know others, who would prefer the approch used for Slide 1 or Slide 3 using the Frame environment. On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use sweave in a beamer presentation. I found the following article http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html and I implemented the laypout file as suggested, but changed it, based on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile frame and a verbatim environment (see layout file attached). But there must be something wrong: when I try to compile the attached lyx file, it gives an error message ()\\i the LaTeX log: I've downloaded your test case on my Ubuntu Linux 8.1 system and I can confirm that your fragile frame environment causes the compile to fail. Here's one way to try and figure what is going on. Instead of using the LyX Layout approach, just write ERT in your lyx document. If that DOES work, then you have good information because it means the fragile frame will work. Then concentrate on the LyX layout. As I said, I am not using it any more. I suppose it would help if we had a tex file with the fragile frame in use, so we could compare the working tex against the tex that LyX creates. With the existing Layout file you provide, you can see a bit more about where this is going wrong if you export the LyX document to TeX format. Then we could compare that TeX file with a working tex file. The file LyX creates will default to batchmode, but you can edit that tex file and erase line 1, the batchmode line. After that, you can run latex or pdflatex on the tex file to see what happens. From looking at that tex file, it appears to me there is a mismatch in the frame begin and end markers. Here's a snip \lyxframeend{}\lyxfragileframe{Slide 1} \includegraphics{beamertest-001} \lyxframeend{}\lyxframe{Slide 2} Note that your Layout causes a \lyxframeend to be inserted, then a \lyxfragileframe, but there is no \lyxfragileframeend, only \lyxframeend. Do you think that is related to the trouble? No - I took the plain frame \lyxframeplain, and changed plain to fragile. Here are some latex errors I see when I run that through. I believe the first one is superficial, but the second is more serious. (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) Package hyperref Warning: Option `pdfpagelabels' is turned off (hyperref) because \thepage is undefined. Hyperref stopped early ) *hyperref using default driver hdvips* (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) (/usr/share/texmf-texlive/tex/generic/babel/babel.sty (/usr/share/texmf-texlive/tex/generic/babel/english.ldf (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/R/Sweave.sty (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.6, with DG/SPQR fixes 1998/07/17 (tvz) No file fancyvrb.cfg. ) (/usr/share/texmf/tex/latex/R/upquote.sty (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./beamertest.out) (./beamertest.out) No file beamertest.nav. ) Runaway argument? ! File ended while scanning use of \next. inserted text \par * beamertest.tex I hope you get this working and let us know how you did it. I got it working, but am not entirely happy. Thanks for your comments, Rainer ### ... No file BeamerSweaveExample.nav. \openout3 = `BeamerSweaveExample.vrb'. ) Runaway argument? ! File ended while scanning use of \next. ... ### When I change from Frame (fragile) to Frame, it compiles, but when setting one echo=TRUE, it does not as it is not in
Re: Usinr Sweave / noweb in BEamer presentation
Rainer M Krug wrote: On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnson pauljoh...@gmail.com wrote: Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I wanted to use it for lectures, where it would be very nice to have the code and the result. I've only spent 40 minutes looking at your case. I don't know what a fragile frame is for, but I'll go read more about it. The problem is obviously that you have an error in the latex macros in your layout file. Trying to find where those problems might be is, well, difficult (since I don't see why you care about changing the frame, mainly). Right - so I decided to use a different approach (see attached file BeamerSweaveExample3.lyx) which is working. My question is just: why is Slide 2 working, but Slide 1 or Slide 3 not, when I say echo=TRUE? I don't have a problem usoing ERT boxes, but I know others, who would prefer the approch used for Slide 1 or Slide 3 using the Frame environment. On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use sweave in a beamer presentation. I found the following article http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html and I implemented the laypout file as suggested, but changed it, based on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile frame and a verbatim environment (see layout file attached). But there must be something wrong: when I try to compile the attached lyx file, it gives an error message ()\\i the LaTeX log: I've downloaded your test case on my Ubuntu Linux 8.1 system and I can confirm that your fragile frame environment causes the compile to fail. Here's one way to try and figure what is going on. Instead of using the LyX Layout approach, just write ERT in your lyx document. If that DOES work, then you have good information because it means the fragile frame will work. Then concentrate on the LyX layout. As I said, I am not using it any more. I suppose it would help if we had a tex file with the fragile frame in use, so we could compare the working tex against the tex that LyX creates. With the existing Layout file you provide, you can see a bit more about where this is going wrong if you export the LyX document to TeX format. Then we could compare that TeX file with a working tex file. The file LyX creates will default to batchmode, but you can edit that tex file and erase line 1, the batchmode line. After that, you can run latex or pdflatex on the tex file to see what happens. From looking at that tex file, it appears to me there is a mismatch in the frame begin and end markers. Here's a snip \lyxframeend{}\lyxfragileframe{Slide 1} \includegraphics{beamertest-001} \lyxframeend{}\lyxframe{Slide 2} Note that your Layout causes a \lyxframeend to be inserted, then a \lyxfragileframe, but there is no \lyxfragileframeend, only \lyxframeend. Do you think that is related to the trouble? No - I took the plain frame \lyxframeplain, and changed plain to fragile. Here are some latex errors I see when I run that through. I believe the first one is superficial, but the second is more serious. (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) Package hyperref Warning: Option `pdfpagelabels' is turned off (hyperref)because \thepage is undefined. Hyperref stopped early ) *hyperref using default driver hdvips* (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) (/usr/share/texmf-texlive/tex/generic/babel/babel.sty (/usr/share/texmf-texlive/tex/generic/babel/english.ldf (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/R/Sweave.sty (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.6, with DG/SPQR fixes 1998/07/17 (tvz) No file fancyvrb.cfg. ) (/usr/share/texmf/tex/latex/R/upquote.sty (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./beamertest.out) (./beamertest.out) No file beamertest.nav. ) Runaway argument? ! File ended while scanning use of \next. inserted text \par * beamertest.tex I hope you get this working and let us know how you did it. I got it working, but am not entirely happy. Thanks for your comments, Rainer ### ... No file BeamerSweaveExample.nav. \openout3 = `BeamerSweaveExample.vrb'. ) Runaway argument? ! File ended while scanning use of \next. ... ### When I change from Frame (fragile) to Frame, it compiles, but when setting one
Re: Usinr Sweave / noweb in BEamer presentation
On Tue, Mar 3, 2009 at 3:23 AM, Rainer M Krug r.m.k...@gmail.com wrote: On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnson pauljoh...@gmail.com wrote: Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I wanted to use it for lectures, where it would be very nice to have the code and the result. Wow, this is frustrating. I've hammered on this all night and I've only succeeded in re-producing the problem as you originally stated it. I believe I've gotten down the base of the problem by repeatedly exporting documents to noweb format and then running them through R. Recall the transformation from LyX first creates a noweb file *.Rnw and then it runs R CMD Sweave whatever.Rnw to create the tex file, which is then processed through latex. It is possible to monitor each step and see where it goes wrong. Using ERT in the lyx document can generate a working document. From the attached example beamerERTSweave.lyx, you should be able to compile the document even if echo=T. Processing that into Rnw and then tex, the working LaTeX is like this: \begin{frame}[containsverbatim] \frametitle{Here's a title} \begin{Schunk} \begin{Sinput} plot(gl(5, 20)) \end{Sinput} \end{Schunk} \includegraphics{beamerERTSweave-001} LaTeX can process that. All we need to do is create a new Frame environment based on beamer.layout that will add the right code. I tried to take the BeginPlainFrame environment and revise it to create BeginVerbatimEnvironment. Like you, I thought this should be a simple change. But it fails. A file you can test is beamertest-1.lyx. I'm attaching the layout files I was using. Maybe somebody who writes lots of layout files will take mercy and tell us how we can modify a frame environment from beamer.layout so that it creates the proper preamble to create the tex we need. If we start with this, which changes are needed? Style BeginPlainFrame Category Frames TocLevel 4 KeepEmpty 1 LatexType Command LatexName lyxframeend{}\lyxplainframe MarginFirst_Dynamic NextNoIndent 1 ParSkip 0 TopSep2.5 BottomSep 0.5 ParSep0 Align Center LabelType Static LabelBottomSep0 LeftMarginM LabelSep xx LabelString Frame (no head/foot/sidebars) Font Series Bold SizeLargest Color Blue EndFont LabelFont Family Roman Color latex EndFont Preamble \makeatletter \long\def\lyxplainframe#...@lyxplainframe#1\@lyxframestop}% \d...@lyxplainframe{\@ifnextchar{\@@lyxplainframe}{\@@lyxplainframe*}}% \long\def\@@lyxplainframe#1#...@lyxframestop#3\lyxframeend{% \frame#1[plain]{\frametitle{#2}#3}} \makeatother EndPreamble End I tried to change lyxplainframe to lyxverbatimframe everywhere and then simply replace [plain] with [containsverbatim] but it didn't get the job done. Oh, well. I'm wondering if this will be useful in the end because it appears to me that the R output does not want to fit itself very nicely onto the tight pages of the beamer layout. But, then again, we might find enthusiasm to fix margins if we could make documents compile when they have Schunk in them. -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas beamertest-1.lyx Description: application/lyx beamerERTSweave.lyx Description: application/lyx pjbeamer.layout Description: Binary data literate-beamer.layout Description: Binary data
Re: Usinr Sweave / noweb in BEamer presentation
On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnson pauljoh...@gmail.com wrote: Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I wanted to use it for lectures, where it would be very nice to have the code and the result. I've only spent 40 minutes looking at your case. I don't know what a fragile frame is for, but I'll go read more about it. The problem is obviously that you have an error in the latex macros in your layout file. Trying to find where those problems might be is, well, difficult (since I don't see why you care about changing the frame, mainly). Right - so I decided to use a different approach (see attached file BeamerSweaveExample3.lyx) which is working. My question is just: why is Slide 2 working, but Slide 1 or Slide 3 not, when I say echo=TRUE? I don't have a problem usoing ERT boxes, but I know others, who would prefer the approch used for Slide 1 or Slide 3 using the Frame environment. On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use sweave in a beamer presentation. I found the following article http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html and I implemented the laypout file as suggested, but changed it, based on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile frame and a verbatim environment (see layout file attached). But there must be something wrong: when I try to compile the attached lyx file, it gives an error message ()\\i the LaTeX log: I've downloaded your test case on my Ubuntu Linux 8.1 system and I can confirm that your fragile frame environment causes the compile to fail. Here's one way to try and figure what is going on. Instead of using the LyX Layout approach, just write ERT in your lyx document. If that DOES work, then you have good information because it means the fragile frame will work. Then concentrate on the LyX layout. As I said, I am not using it any more. I suppose it would help if we had a tex file with the fragile frame in use, so we could compare the working tex against the tex that LyX creates. With the existing Layout file you provide, you can see a bit more about where this is going wrong if you export the LyX document to TeX format. Then we could compare that TeX file with a working tex file. The file LyX creates will default to batchmode, but you can edit that tex file and erase line 1, the batchmode line. After that, you can run latex or pdflatex on the tex file to see what happens. From looking at that tex file, it appears to me there is a mismatch in the frame begin and end markers. Here's a snip \lyxframeend{}\lyxfragileframe{Slide 1} \includegraphics{beamertest-001} \lyxframeend{}\lyxframe{Slide 2} Note that your Layout causes a \lyxframeend to be inserted, then a \lyxfragileframe, but there is no \lyxfragileframeend, only \lyxframeend. Do you think that is related to the trouble? No - I took the plain frame \lyxframeplain, and changed plain to fragile. Here are some latex errors I see when I run that through. I believe the first one is superficial, but the second is more serious. (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) Package hyperref Warning: Option `pdfpagelabels' is turned off (hyperref) because \thepage is undefined. Hyperref stopped early ) *hyperref using default driver hdvips* (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) (/usr/share/texmf-texlive/tex/generic/babel/babel.sty (/usr/share/texmf-texlive/tex/generic/babel/english.ldf (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/R/Sweave.sty (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.6, with DG/SPQR fixes 1998/07/17 (tvz) No file fancyvrb.cfg. ) (/usr/share/texmf/tex/latex/R/upquote.sty (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./beamertest.out) (./beamertest.out) No file beamertest.nav. ) Runaway argument? ! File ended while scanning use of \next. inserted text \par * beamertest.tex I hope you get this working and let us know how you did it. I got it working, but am not entirely happy. Thanks for your comments, Rainer ### ... No file BeamerSweaveExample.nav. \openout3 = `BeamerSweaveExample.vrb'. ) Runaway argument? ! File ended while scanning use of \next. ... ### When I change from Frame (fragile) to Frame, it compiles, but when setting one echo=TRUE, it does not as it is not in
Re: Usinr Sweave / noweb in BEamer presentation
Rainer M Krug wrote: On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnson pauljoh...@gmail.com wrote: Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I wanted to use it for lectures, where it would be very nice to have the code and the result. I've only spent 40 minutes looking at your case. I don't know what a fragile frame is for, but I'll go read more about it. The problem is obviously that you have an error in the latex macros in your layout file. Trying to find where those problems might be is, well, difficult (since I don't see why you care about changing the frame, mainly). Right - so I decided to use a different approach (see attached file BeamerSweaveExample3.lyx) which is working. My question is just: why is Slide 2 working, but Slide 1 or Slide 3 not, when I say echo=TRUE? I don't have a problem usoing ERT boxes, but I know others, who would prefer the approch used for Slide 1 or Slide 3 using the Frame environment. On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use sweave in a beamer presentation. I found the following article http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html and I implemented the laypout file as suggested, but changed it, based on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile frame and a verbatim environment (see layout file attached). But there must be something wrong: when I try to compile the attached lyx file, it gives an error message ()\\i the LaTeX log: I've downloaded your test case on my Ubuntu Linux 8.1 system and I can confirm that your fragile frame environment causes the compile to fail. Here's one way to try and figure what is going on. Instead of using the LyX Layout approach, just write ERT in your lyx document. If that DOES work, then you have good information because it means the fragile frame will work. Then concentrate on the LyX layout. As I said, I am not using it any more. I suppose it would help if we had a tex file with the fragile frame in use, so we could compare the working tex against the tex that LyX creates. With the existing Layout file you provide, you can see a bit more about where this is going wrong if you export the LyX document to TeX format. Then we could compare that TeX file with a working tex file. The file LyX creates will default to batchmode, but you can edit that tex file and erase line 1, the batchmode line. After that, you can run latex or pdflatex on the tex file to see what happens. From looking at that tex file, it appears to me there is a mismatch in the frame begin and end markers. Here's a snip \lyxframeend{}\lyxfragileframe{Slide 1} \includegraphics{beamertest-001} \lyxframeend{}\lyxframe{Slide 2} Note that your Layout causes a \lyxframeend to be inserted, then a \lyxfragileframe, but there is no \lyxfragileframeend, only \lyxframeend. Do you think that is related to the trouble? No - I took the plain frame \lyxframeplain, and changed plain to fragile. Here are some latex errors I see when I run that through. I believe the first one is superficial, but the second is more serious. (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) Package hyperref Warning: Option `pdfpagelabels' is turned off (hyperref)because \thepage is undefined. Hyperref stopped early ) *hyperref using default driver hdvips* (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) (/usr/share/texmf-texlive/tex/generic/babel/babel.sty (/usr/share/texmf-texlive/tex/generic/babel/english.ldf (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/R/Sweave.sty (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.6, with DG/SPQR fixes 1998/07/17 (tvz) No file fancyvrb.cfg. ) (/usr/share/texmf/tex/latex/R/upquote.sty (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./beamertest.out) (./beamertest.out) No file beamertest.nav. ) Runaway argument? ! File ended while scanning use of \next. inserted text \par * beamertest.tex I hope you get this working and let us know how you did it. I got it working, but am not entirely happy. Thanks for your comments, Rainer ### ... No file BeamerSweaveExample.nav. \openout3 = `BeamerSweaveExample.vrb'. ) Runaway argument? ! File ended while scanning use of \next. ... ### When I change from Frame (fragile) to Frame, it compiles, but when setting one
Re: Usinr Sweave / noweb in BEamer presentation
On Tue, Mar 3, 2009 at 3:23 AM, Rainer M Krug r.m.k...@gmail.com wrote: On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnson pauljoh...@gmail.com wrote: Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I wanted to use it for lectures, where it would be very nice to have the code and the result. Wow, this is frustrating. I've hammered on this all night and I've only succeeded in re-producing the problem as you originally stated it. I believe I've gotten down the base of the problem by repeatedly exporting documents to noweb format and then running them through R. Recall the transformation from LyX first creates a noweb file *.Rnw and then it runs R CMD Sweave whatever.Rnw to create the tex file, which is then processed through latex. It is possible to monitor each step and see where it goes wrong. Using ERT in the lyx document can generate a working document. From the attached example beamerERTSweave.lyx, you should be able to compile the document even if echo=T. Processing that into Rnw and then tex, the working LaTeX is like this: \begin{frame}[containsverbatim] \frametitle{Here's a title} \begin{Schunk} \begin{Sinput} plot(gl(5, 20)) \end{Sinput} \end{Schunk} \includegraphics{beamerERTSweave-001} LaTeX can process that. All we need to do is create a new Frame environment based on beamer.layout that will add the right code. I tried to take the BeginPlainFrame environment and revise it to create BeginVerbatimEnvironment. Like you, I thought this should be a simple change. But it fails. A file you can test is beamertest-1.lyx. I'm attaching the layout files I was using. Maybe somebody who writes lots of layout files will take mercy and tell us how we can modify a frame environment from beamer.layout so that it creates the proper preamble to create the tex we need. If we start with this, which changes are needed? Style BeginPlainFrame Category Frames TocLevel 4 KeepEmpty 1 LatexType Command LatexName lyxframeend{}\lyxplainframe MarginFirst_Dynamic NextNoIndent 1 ParSkip 0 TopSep2.5 BottomSep 0.5 ParSep0 Align Center LabelType Static LabelBottomSep0 LeftMarginM LabelSep xx LabelString Frame (no head/foot/sidebars) Font Series Bold SizeLargest Color Blue EndFont LabelFont Family Roman Color latex EndFont Preamble \makeatletter \long\def\lyxplainframe#...@lyxplainframe#1\@lyxframestop}% \d...@lyxplainframe{\@ifnextchar{\@@lyxplainframe}{\@@lyxplainframe*}}% \long\def\@@lyxplainframe#1#...@lyxframestop#3\lyxframeend{% \frame#1[plain]{\frametitle{#2}#3}} \makeatother EndPreamble End I tried to change lyxplainframe to lyxverbatimframe everywhere and then simply replace [plain] with [containsverbatim] but it didn't get the job done. Oh, well. I'm wondering if this will be useful in the end because it appears to me that the R output does not want to fit itself very nicely onto the tight pages of the beamer layout. But, then again, we might find enthusiasm to fix margins if we could make documents compile when they have Schunk in them. -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas beamertest-1.lyx Description: application/lyx beamerERTSweave.lyx Description: application/lyx pjbeamer.layout Description: Binary data literate-beamer.layout Description: Binary data
Re: Usinr Sweave / noweb in BEamer presentation
On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnsonwrote: > Hello, I don't have any answers, but I have some questions for you.. I > have an interest because I have been using LyX with Sweave a long > time, but have not yet needed a beamer Sweave. I wanted to use it for lectures, where it would be very nice to have the code and the result. > > I've only spent 40 minutes looking at your case. I don't know what a > fragile frame is for, but I'll go read more about it. > > The problem is obviously that you have an error in the latex macros in > your layout file. Trying to find where those problems might be is, > well, difficult (since I don't see why you care about changing the > frame, mainly). Right - so I decided to use a different approach (see attached file BeamerSweaveExample3.lyx) which is working. My question is just: why is "Slide 2" working, but "Slide 1" or "Slide 3" not, when I say "echo=TRUE"? I don't have a problem usoing ERT boxes, but I know others, who would prefer the approch used for "Slide 1" or "Slide 3" using the Frame environment. > > On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krug wrote: >> Hi >> >> I want to use sweave in a beamer presentation. I found the following article >> http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html >> >> and I implemented the laypout file as suggested, but changed it, based >> on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile >> frame and a verbatim environment (see layout file attached). >> >> But there must be something wrong: when I try to compile the attached >> lyx file, it gives an error message ()\\i the LaTeX log: >> > > I've downloaded your test case on my Ubuntu Linux 8.1 system and I can > confirm that your fragile frame environment causes the compile to > fail. Here's one way to try and figure what is going on. Instead of > using the LyX Layout approach, just write ERT in your lyx document. If > that DOES work, then you have good information because it means the > fragile frame will work. Then concentrate on the LyX layout. As I said, I am not using it any more. > > I suppose it would help if we had a tex file with the fragile frame in > use, so we could compare the working tex against the tex that LyX > creates. > > With the existing Layout file you provide, you can see a bit more > about where this is going wrong if you export the LyX document to TeX > format. Then we could compare that TeX file with a working tex file. > The file LyX creates will default to batchmode, but you can edit that > tex file and erase line 1, the batchmode line. After that, you can > run latex or pdflatex on the tex file to see what happens. > > From looking at that tex file, it appears to me there is a mismatch in > the frame begin and end markers. Here's a snip > > > \lyxframeend{}\lyxfragileframe{Slide 1} > > \includegraphics{beamertest-001} > > > \lyxframeend{}\lyxframe{Slide 2} > > > Note that your Layout causes a \lyxframeend to be inserted, then a > \lyxfragileframe, but there is no \lyxfragileframeend, only > \lyxframeend. Do you think that is related to the trouble? No - I took the plain frame \lyxframeplain, and changed "plain" to "fragile". > > Here are some latex errors I see when I run that through. I believe > the first one is superficial, but the second is more serious. > > (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) > > Package hyperref Warning: Option `pdfpagelabels' is turned off > (hyperref) because \thepage is undefined. > > Hyperref stopped early > ) > *hyperref using default driver hdvips* > > > (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) > (/usr/share/texmf-texlive/tex/generic/babel/babel.sty > (/usr/share/texmf-texlive/tex/generic/babel/english.ldf > (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) > (/usr/share/texmf/tex/latex/R/Sweave.sty > (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) > (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty > Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/07/17> (tvz) > No file fancyvrb.cfg. > ) (/usr/share/texmf/tex/latex/R/upquote.sty > (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty > (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) > (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) > (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty > (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./beamertest.out) > (./beamertest.out) > No file beamertest.nav. > ) > Runaway argument? > ! File ended while scanning use of \next. > > \par > <*> beamertest.tex > > > > I hope you get this working and let us know how you did it. I got it working, but am not entirely happy. Thanks for your comments, Rainer > > > > >> ### >> ... >> No file BeamerSweaveExample.nav. >> \openout3 = `BeamerSweaveExample.vrb'. >> >> ) >> Runaway argument? >> ! File ended while scanning use of
Re: Usinr Sweave / noweb in BEamer presentation
Rainer M Krug wrote: > On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnsonwrote: >> Hello, I don't have any answers, but I have some questions for you.. I >> have an interest because I have been using LyX with Sweave a long >> time, but have not yet needed a beamer Sweave. > > I wanted to use it for lectures, where it would be very nice to have > the code and the result. > >> I've only spent 40 minutes looking at your case. I don't know what a >> fragile frame is for, but I'll go read more about it. >> >> The problem is obviously that you have an error in the latex macros in >> your layout file. Trying to find where those problems might be is, >> well, difficult (since I don't see why you care about changing the >> frame, mainly). > > Right - so I decided to use a different approach (see attached file > BeamerSweaveExample3.lyx) which is working. > > My question is just: why is "Slide 2" working, but "Slide 1" or "Slide > 3" not, when I say "echo=TRUE"? > > I don't have a problem usoing ERT boxes, but I know others, who would > prefer the approch used for "Slide 1" or "Slide 3" using the Frame > environment. > >> On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krug wrote: >>> Hi >>> >>> I want to use sweave in a beamer presentation. I found the following article >>> http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html >>> >>> and I implemented the laypout file as suggested, but changed it, based >>> on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile >>> frame and a verbatim environment (see layout file attached). >>> >>> But there must be something wrong: when I try to compile the attached >>> lyx file, it gives an error message ()\\i the LaTeX log: >>> >> I've downloaded your test case on my Ubuntu Linux 8.1 system and I can >> confirm that your fragile frame environment causes the compile to >> fail. Here's one way to try and figure what is going on. Instead of >> using the LyX Layout approach, just write ERT in your lyx document. If >> that DOES work, then you have good information because it means the >> fragile frame will work. Then concentrate on the LyX layout. > > As I said, I am not using it any more. > >> I suppose it would help if we had a tex file with the fragile frame in >> use, so we could compare the working tex against the tex that LyX >> creates. >> >> With the existing Layout file you provide, you can see a bit more >> about where this is going wrong if you export the LyX document to TeX >> format. Then we could compare that TeX file with a working tex file. >> The file LyX creates will default to batchmode, but you can edit that >> tex file and erase line 1, the batchmode line. After that, you can >> run latex or pdflatex on the tex file to see what happens. >> >> From looking at that tex file, it appears to me there is a mismatch in >> the frame begin and end markers. Here's a snip >> >> >> \lyxframeend{}\lyxfragileframe{Slide 1} >> >> \includegraphics{beamertest-001} >> >> >> \lyxframeend{}\lyxframe{Slide 2} >> >> >> Note that your Layout causes a \lyxframeend to be inserted, then a >> \lyxfragileframe, but there is no \lyxfragileframeend, only >> \lyxframeend. Do you think that is related to the trouble? > > No - I took the plain frame \lyxframeplain, and changed "plain" to "fragile". > >> Here are some latex errors I see when I run that through. I believe >> the first one is superficial, but the second is more serious. >> >> (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) >> >> Package hyperref Warning: Option `pdfpagelabels' is turned off >> (hyperref)because \thepage is undefined. >> >> Hyperref stopped early >> ) >> *hyperref using default driver hdvips* >> >> >> (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) >> (/usr/share/texmf-texlive/tex/generic/babel/babel.sty >> (/usr/share/texmf-texlive/tex/generic/babel/english.ldf >> (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) >> (/usr/share/texmf/tex/latex/R/Sweave.sty >> (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) >> (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty >> Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/07/17> (tvz) >> No file fancyvrb.cfg. >> ) (/usr/share/texmf/tex/latex/R/upquote.sty >> (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty >> (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) >> (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) >> (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty >> (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) >> (./beamertest.out) >> (./beamertest.out) >> No file beamertest.nav. >> ) >> Runaway argument? >> ! File ended while scanning use of \next. >> >>\par >> <*> beamertest.tex >> >> >> >> I hope you get this working and let us know how you did it. > > I got it working, but am not entirely happy. > > Thanks for your comments, > > Rainer >
Re: Usinr Sweave / noweb in BEamer presentation
On Tue, Mar 3, 2009 at 3:23 AM, Rainer M Krugwrote: > On Mon, Mar 2, 2009 at 10:30 PM, Paul Johnson wrote: >> Hello, I don't have any answers, but I have some questions for you.. I >> have an interest because I have been using LyX with Sweave a long >> time, but have not yet needed a beamer Sweave. > > I wanted to use it for lectures, where it would be very nice to have > the code and the result. > > Wow, this is frustrating. I've hammered on this all night and I've only succeeded in re-producing the problem as you originally stated it. I believe I've gotten down the base of the problem by repeatedly exporting documents to noweb format and then running them through R. Recall the transformation from LyX first creates a noweb file *.Rnw and then it runs "R CMD Sweave whatever.Rnw" to create the tex file, which is then processed through latex. It is possible to monitor each step and see where it goes wrong. Using ERT in the lyx document can generate a working document. From the attached example "beamerERTSweave.lyx", you should be able to compile the document even if echo=T. Processing that into Rnw and then tex, the working LaTeX is like this: \begin{frame}[containsverbatim] \frametitle{Here's a title} \begin{Schunk} \begin{Sinput} > plot(gl(5, 20)) \end{Sinput} \end{Schunk} \includegraphics{beamerERTSweave-001} LaTeX can process that. All we need to do is create a new Frame environment based on beamer.layout that will add the right code. I tried to take the BeginPlainFrame environment and revise it to create BeginVerbatimEnvironment. Like you, I thought this should be a simple change. But it fails. A file you can test is "beamertest-1.lyx". I'm attaching the layout files I was using. Maybe somebody who writes lots of layout files will take mercy and tell us how we can modify a frame environment from beamer.layout so that it creates the proper preamble to create the tex we need. If we start with this, which changes are needed? Style BeginPlainFrame Category Frames TocLevel 4 KeepEmpty 1 LatexType Command LatexName lyxframeend{}\lyxplainframe MarginFirst_Dynamic NextNoIndent 1 ParSkip 0 TopSep2.5 BottomSep 0.5 ParSep0 Align Center LabelType Static LabelBottomSep0 LeftMarginM LabelSep xx LabelString "Frame (no head/foot/sidebars)" Font Series Bold SizeLargest Color Blue EndFont LabelFont Family Roman Color latex EndFont Preamble \makeatletter \long\def\lyxplainframe#...@lyxplainframe#1\@lyxframestop}% \d...@lyxplainframe{\@ifnextchar<{\@@lyxplainframe}{\@@lyxplainframe<*>}}% \long\def\@@lyxplainframe<#1>#...@lyxframestop#3\lyxframeend{% \frame<#1>[plain]{\frametitle{#2}#3}} \makeatother EndPreamble End I tried to change "lyxplainframe" to "lyxverbatimframe" everywhere and then simply replace [plain] with [containsverbatim] but it didn't get the job done. Oh, well. I'm wondering if this will be useful in the end because it appears to me that the R output does not want to fit itself very nicely onto the tight pages of the beamer layout. But, then again, we might find enthusiasm to fix margins if we could make documents compile when they have Schunk in them. -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas beamertest-1.lyx Description: application/lyx beamerERTSweave.lyx Description: application/lyx pjbeamer.layout Description: Binary data literate-beamer.layout Description: Binary data
Re: Usinr Sweave / noweb in BEamer presentation
Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I've only spent 40 minutes looking at your case. I don't know what a fragile frame is for, but I'll go read more about it. The problem is obviously that you have an error in the latex macros in your layout file. Trying to find where those problems might be is, well, difficult (since I don't see why you care about changing the frame, mainly). On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use sweave in a beamer presentation. I found the following article http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html and I implemented the laypout file as suggested, but changed it, based on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile frame and a verbatim environment (see layout file attached). But there must be something wrong: when I try to compile the attached lyx file, it gives an error message ()\\i the LaTeX log: I've downloaded your test case on my Ubuntu Linux 8.1 system and I can confirm that your fragile frame environment causes the compile to fail. Here's one way to try and figure what is going on. Instead of using the LyX Layout approach, just write ERT in your lyx document. If that DOES work, then you have good information because it means the fragile frame will work. Then concentrate on the LyX layout. I suppose it would help if we had a tex file with the fragile frame in use, so we could compare the working tex against the tex that LyX creates. With the existing Layout file you provide, you can see a bit more about where this is going wrong if you export the LyX document to TeX format. Then we could compare that TeX file with a working tex file. The file LyX creates will default to batchmode, but you can edit that tex file and erase line 1, the batchmode line. After that, you can run latex or pdflatex on the tex file to see what happens. From looking at that tex file, it appears to me there is a mismatch in the frame begin and end markers. Here's a snip \lyxframeend{}\lyxfragileframe{Slide 1} \includegraphics{beamertest-001} \lyxframeend{}\lyxframe{Slide 2} Note that your Layout causes a \lyxframeend to be inserted, then a \lyxfragileframe, but there is no \lyxfragileframeend, only \lyxframeend. Do you think that is related to the trouble? Here are some latex errors I see when I run that through. I believe the first one is superficial, but the second is more serious. (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) Package hyperref Warning: Option `pdfpagelabels' is turned off (hyperref)because \thepage is undefined. Hyperref stopped early ) *hyperref using default driver hdvips* (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) (/usr/share/texmf-texlive/tex/generic/babel/babel.sty (/usr/share/texmf-texlive/tex/generic/babel/english.ldf (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/R/Sweave.sty (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.6, with DG/SPQR fixes 1998/07/17 (tvz) No file fancyvrb.cfg. ) (/usr/share/texmf/tex/latex/R/upquote.sty (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./beamertest.out) (./beamertest.out) No file beamertest.nav. ) Runaway argument? ! File ended while scanning use of \next. inserted text \par * beamertest.tex I hope you get this working and let us know how you did it. ### ... No file BeamerSweaveExample.nav. \openout3 = `BeamerSweaveExample.vrb'. ) Runaway argument? ! File ended while scanning use of \next. ... ### When I change from Frame (fragile) to Frame, it compiles, but when setting one echo=TRUE, it does not as it is not in verbtim. If I set the environment of the ERT to Verbatim, it still does not compile. What am I missing? Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Faculty of Science Natural Sciences Building Private Bag X1 University of Stellenbosch Matieland 7602 South Africa -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas
Re: Usinr Sweave / noweb in BEamer presentation
Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I've only spent 40 minutes looking at your case. I don't know what a fragile frame is for, but I'll go read more about it. The problem is obviously that you have an error in the latex macros in your layout file. Trying to find where those problems might be is, well, difficult (since I don't see why you care about changing the frame, mainly). On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krug r.m.k...@gmail.com wrote: Hi I want to use sweave in a beamer presentation. I found the following article http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html and I implemented the laypout file as suggested, but changed it, based on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile frame and a verbatim environment (see layout file attached). But there must be something wrong: when I try to compile the attached lyx file, it gives an error message ()\\i the LaTeX log: I've downloaded your test case on my Ubuntu Linux 8.1 system and I can confirm that your fragile frame environment causes the compile to fail. Here's one way to try and figure what is going on. Instead of using the LyX Layout approach, just write ERT in your lyx document. If that DOES work, then you have good information because it means the fragile frame will work. Then concentrate on the LyX layout. I suppose it would help if we had a tex file with the fragile frame in use, so we could compare the working tex against the tex that LyX creates. With the existing Layout file you provide, you can see a bit more about where this is going wrong if you export the LyX document to TeX format. Then we could compare that TeX file with a working tex file. The file LyX creates will default to batchmode, but you can edit that tex file and erase line 1, the batchmode line. After that, you can run latex or pdflatex on the tex file to see what happens. From looking at that tex file, it appears to me there is a mismatch in the frame begin and end markers. Here's a snip \lyxframeend{}\lyxfragileframe{Slide 1} \includegraphics{beamertest-001} \lyxframeend{}\lyxframe{Slide 2} Note that your Layout causes a \lyxframeend to be inserted, then a \lyxfragileframe, but there is no \lyxfragileframeend, only \lyxframeend. Do you think that is related to the trouble? Here are some latex errors I see when I run that through. I believe the first one is superficial, but the second is more serious. (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) Package hyperref Warning: Option `pdfpagelabels' is turned off (hyperref)because \thepage is undefined. Hyperref stopped early ) *hyperref using default driver hdvips* (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) (/usr/share/texmf-texlive/tex/generic/babel/babel.sty (/usr/share/texmf-texlive/tex/generic/babel/english.ldf (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/R/Sweave.sty (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.6, with DG/SPQR fixes 1998/07/17 (tvz) No file fancyvrb.cfg. ) (/usr/share/texmf/tex/latex/R/upquote.sty (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./beamertest.out) (./beamertest.out) No file beamertest.nav. ) Runaway argument? ! File ended while scanning use of \next. inserted text \par * beamertest.tex I hope you get this working and let us know how you did it. ### ... No file BeamerSweaveExample.nav. \openout3 = `BeamerSweaveExample.vrb'. ) Runaway argument? ! File ended while scanning use of \next. ... ### When I change from Frame (fragile) to Frame, it compiles, but when setting one echo=TRUE, it does not as it is not in verbtim. If I set the environment of the ERT to Verbatim, it still does not compile. What am I missing? Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Faculty of Science Natural Sciences Building Private Bag X1 University of Stellenbosch Matieland 7602 South Africa -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas
Re: Usinr Sweave / noweb in BEamer presentation
Hello, I don't have any answers, but I have some questions for you.. I have an interest because I have been using LyX with Sweave a long time, but have not yet needed a beamer Sweave. I've only spent 40 minutes looking at your case. I don't know what a fragile frame is for, but I'll go read more about it. The problem is obviously that you have an error in the latex macros in your layout file. Trying to find where those problems might be is, well, difficult (since I don't see why you care about changing the frame, mainly). On Mon, Mar 2, 2009 at 1:53 AM, Rainer M Krugwrote: > Hi > > I want to use sweave in a beamer presentation. I found the following article > http://ggorjan.blogspot.com/2008/09/using-beamer-with-lyx-sweave.html > > and I implemented the laypout file as suggested, but changed it, based > on the BeamerUserGuide.pdf 3.13 Verbatim Text, tho include a fragile > frame and a verbatim environment (see layout file attached). > > But there must be something wrong: when I try to compile the attached > lyx file, it gives an error message ()\\i the LaTeX log: > I've downloaded your test case on my Ubuntu Linux 8.1 system and I can confirm that your fragile frame environment causes the compile to fail. Here's one way to try and figure what is going on. Instead of using the LyX Layout approach, just write ERT in your lyx document. If that DOES work, then you have good information because it means the fragile frame will work. Then concentrate on the LyX layout. I suppose it would help if we had a tex file with the fragile frame in use, so we could compare the working tex against the tex that LyX creates. With the existing Layout file you provide, you can see a bit more about where this is going wrong if you export the LyX document to TeX format. Then we could compare that TeX file with a working tex file. The file LyX creates will default to batchmode, but you can edit that tex file and erase line 1, the batchmode line. After that, you can run latex or pdflatex on the tex file to see what happens. >From looking at that tex file, it appears to me there is a mismatch in the frame begin and end markers. Here's a snip \lyxframeend{}\lyxfragileframe{Slide 1} \includegraphics{beamertest-001} \lyxframeend{}\lyxframe{Slide 2} Note that your Layout causes a \lyxframeend to be inserted, then a \lyxfragileframe, but there is no \lyxfragileframeend, only \lyxframeend. Do you think that is related to the trouble? Here are some latex errors I see when I run that through. I believe the first one is superficial, but the second is more serious. (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) Package hyperref Warning: Option `pdfpagelabels' is turned off (hyperref)because \thepage is undefined. Hyperref stopped early ) *hyperref using default driver hdvips* (/usr/share/texmf/tex/latex/beamer/themes/color/beamercolorthemewhale.sty)) (/usr/share/texmf-texlive/tex/generic/babel/babel.sty (/usr/share/texmf-texlive/tex/generic/babel/english.ldf (/usr/share/texmf-texlive/tex/generic/babel/babel.def))) (/usr/share/texmf/tex/latex/R/Sweave.sty (/usr/share/texmf-texlive/tex/latex/base/ifthen.sty) (/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/07/17> (tvz) No file fancyvrb.cfg. ) (/usr/share/texmf/tex/latex/R/upquote.sty (/usr/share/texmf-texlive/tex/latex/base/textcomp.sty (/usr/share/texmf-texlive/tex/latex/base/ts1enc.def (./beamertest.aux) (/usr/share/texmf-texlive/tex/latex/base/ts1cmr.fd) (/usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./beamertest.out) (./beamertest.out) No file beamertest.nav. ) Runaway argument? ! File ended while scanning use of \next. \par <*> beamertest.tex I hope you get this working and let us know how you did it. > ### > ... > No file BeamerSweaveExample.nav. > \openout3 = `BeamerSweaveExample.vrb'. > > ) > Runaway argument? > ! File ended while scanning use of \next. > ... > ### > > When I change from "Frame (fragile)" to "Frame", it compiles, but when > setting one "echo=TRUE", it does not as it is not in "verbtim". If I > set the environment of the ERT to Verbatim, it still does not compile. > > What am I missing? > > Thanks, > > Rainer > > > -- > Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation > Biology, UCT), Dipl. Phys. (Germany) > > Centre of Excellence for Invasion Biology > Faculty of Science > Natural Sciences Building > Private Bag X1 > University of Stellenbosch > Matieland 7602 > South Africa > -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas