Dear Renaud, > Getting back to the \Sexpr issue, I tried with R-2.14.0 and I still see > the following issues: > > - verbatim multiline is not shown properly on PDF > (\Sexpr[results=verbatim, stage=render]{cat("line\nnext line")})
You probably meant to use `paste', not `cat'. The latter sends its output somewhere and returns NULL, not the string. Best, Georgi -- Dr Georgi Boshnakov tel: (+44) (0)161 306 3684 School of Mathematics fax: (+44) (0)161 306 3669 Alan Turing Building 1.125 The University of Manchester email: georgi.boshna...@manchester.ac.uk Oxford Road Manchester M13 9PL UK ------------------------------ Message: 18 Date: Tue, 01 Nov 2011 12:22:30 +0200 From: Renaud Gaujoux <ren...@mancala.cbio.uct.ac.za> To: Duncan Murdoch <murdoch.dun...@gmail.com> Cc: Renaud Gaujoux <ren...@mancala.cbio.uct.ac.za>, "r-devel@r-project.org" <r-devel@r-project.org> Subject: Re: [Rd] R CMD check and error in an \Sexpr in an Rd file Message-ID: <4eafc866.6040...@cbio.uct.ac.za> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Getting back to the \Sexpr issue, I tried with R-2.14.0 and I still see the following issues: - verbatim multiline is not shown properly on PDF (\Sexpr[results=verbatim, stage=render]{cat("line\nnext line")}) - verbatim with empty lines breaks PDF generation (\Sexpr[results=verbatim, stage=render]{cat("line\nnext line\n\nyet another line")}). Would there be an issue in using a plain Latex verbatim environment for \Sexpr[results=verbatim]? - an error in an \Sexpr (\Sexpr[results=verbatim, stage=render]{stop("error in sexpr")}) gives the following in R CMD check: * checking examples ... ERROR Error in paste(before, x, after, sep = "") : object 'exfile' not found Execution halted The two first issues can be reproduced with a call to R CMD Rd2pdf on the Rd code below. Thank you. Renaud. %%%%%%%%%%% \name{Sexpr} \alias{Sexpr} \title{Error and verbatim in Sexpr} \description{ Testing Sexpr in Rd files %\Sexpr[results=verbatim, stage=render]{stop("error in sexpr")} \Sexpr[results=verbatim, stage=render]{cat("line\nnext line")} %\Sexpr[results=verbatim, stage=render]{cat("line\nnext line\n\nyet another line")} } %%%%%%%%%%% -- Renaud Gaujoux Computational Biology - University of Cape Town South Africa On 28/10/2011 17:25, Duncan Murdoch wrote: > On 28/10/2011 10:53 AM, Duncan Murdoch wrote: >> On 28/10/2011 10:49 AM, Renaud Gaujoux wrote: >> > Hi, >> > >> > another Rd related issue I encountered is that if an error occurs >> in an >> > \Sexpr in an Rd file, then on get the following error: >> > >> > * checking for portable compilation flags in Makevars ... OK >> > * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK >> > * checking examples ... ERROR >> > Error in paste(before, x, after, sep = "") : object 'exfile' not >> found >> > Execution halted >> > >> > To reproduce, put a call like this in an Rd section: >> > >> > \Sexpr[results=verbatim, stage=render]{x<- 1; stop("sexpr error")} >> > >> > The strange thing is that it occurs at the example checking step. >> > Not sure why it does not break before. >> > >> > Thank you. >> > >> > Renaud >> > >> > PS: I am on R version 2.13.2 (2011-09-30) - x86_64-pc-linux-gnu >> (64-bit) >> > >> >> I would update to 2.13.2 patched, or the release candidate of 2.14.0. > > Oops, sorry, 2.13.2 is "final", so I didn't backport the patch. > 2.14.0 is what you should get. > > Duncan Murdoch ------------------------------ _______________________________________________ R-devel@r-project.org mailing list DIGESTED https://stat.ethz.ch/mailman/listinfo/r-devel End of R-devel Digest, Vol 105, Issue 1 *************************************** ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel