I am using 32-bit R 3.1.2 on Windows 7. I recently conducted an `R CMD check --as-cran` on a recently-developed package and received only the 'New submission' note. Research on StackOverflow and on R-devel suggested this could be ignored. I also used devtools::build_win() and received no notes or warnings, other than the one mentioned previously. Lastly, I conducted an `R CMD check` with the development version of R. Further, I built the package locally with `R CMD build` and `R CMD INSTALL --build` and everything worked as it should, including the PDF manual. Upon submission to CRAN, I was told that a warning was thrown: This fails to make its manual: * checking PDF version of manual ... WARNING LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors found: ! Missing $ inserted. <inserted text> $ l.682 }{} ! Missing } inserted. <inserted text> } l.682 }{} ... The line appears to be \widehat{R_1} \frac{\sum\limits_{i=1}^n{c_i/n}}{\sum\limits_{i=1}^n{L_i/n}} I asked for assistance in resolving this issue as I could not replicate the WARNING. Another user could replicate the warning on Ubuntu 12.04 but was able to resolve the issue by removing the DOS end-of-line markers (^M or Ctrl-M) from the .Rd file. Neither he nor I could find anything in the R Extensions Manual that discussed removing end-of-line markers. Link to the thread on StackOverflow.com: http://stackoverflow.com/questions/27756679/cran-finds-an-warning-that-r-cmd-check-as-cran-does-not Link to GitHub repository: http://www.github.com/stevenranney/creelSurvey Is this an obscure cross platform issue? If so, I would have thought that someone else would have already discovered this. If this is normal behavior, is there a simple way to remove these end of line markers so I can minimize WARNINGS from CRAN in the future? Thanks - Steven Ranney [[alternative HTML version deleted]]
Dirk Eddelbuettel
2015-Jan-03 23:53 UTC
[Rd] Potential cross-platform package building issue
On 3 January 2015 at 13:49, Steven Ranney wrote: | I am using 32-bit R 3.1.2 on Windows 7. | | I recently conducted an `R CMD check --as-cran` on a recently-developed | package and received only the 'New submission' note. Research on | StackOverflow and on R-devel suggested this could be ignored. I also used | devtools::build_win() and received no notes or warnings, other than the one | mentioned previously. Lastly, I conducted an `R CMD check` with the | development version of R. Further, I built the package locally with `R CMD | build` and `R CMD INSTALL --build` and everything worked as it should, | including the PDF manual. | | Upon submission to CRAN, I was told that a warning was thrown: | | This fails to make its manual: | * checking PDF version of manual ... WARNING | LaTeX errors when creating PDF version. | This typically indicates Rd problems. | LaTeX errors found: | ! Missing $ inserted. | <inserted text> | $ | l.682 }{} | ! Missing } inserted. | <inserted text> | } | l.682 | }{} | ... | | The line appears to be | \widehat{R_1} | \frac{\sum\limits_{i=1}^n{c_i/n}}{\sum\limits_{i=1}^n{L_i/n}} | | I asked for assistance in resolving this issue as I could not replicate the | WARNING. Another user could replicate the warning on Ubuntu 12.04 but was | able to resolve the issue by removing the DOS end-of-line markers (^M or | Ctrl-M) from the .Rd file. Neither he nor I could find anything in the R | Extensions Manual that discussed removing end-of-line markers. | | Link to the thread on StackOverflow.com: | http://stackoverflow.com/questions/27756679/cran-finds-an-warning-that-r-cmd-check-as-cran-does-not | | Link to GitHub repository: http://www.github.com/stevenranney/creelSurvey | | Is this an obscure cross platform issue? If so, I would have thought that | someone else would have already discovered this. If this is normal | behavior, is there a simple way to remove these end of line markers so I | can minimize WARNINGS from CRAN in the future? Given that you pointed to a GH repo, I quickly fetched it as a zip archive. This looks like a vanilla tex coding issue to me: * checking PDF version of manual ... WARNING LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors found: ! Missing $ inserted. <inserted text> $ l.682 }{} ! Missing } inserted. <inserted text> } l.682 }{} ! Display math should end with $$. <to be read again> \@@par l.682 }{} ! Extra }, or forgotten \endgroup. \par ...m \@noitemerr {\@@par }\fi \else {\@@par } \fi l.682 }{} ! Missing $ inserted. <inserted text> $ l.682 }{} ! Missing $ inserted. <inserted text> $ l.682 }{} ! Missing } inserted. <inserted text> } l.682 }{} ! Extra }, or forgotten \endgroup. \par ...m \@noitemerr {\@@par }\fi \else {\@@par } \fi l.682 }{} ! LaTeX Error: Bad math environment delimiter. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... ! Missing $ inserted. <inserted text> $ l.724 }{} ! Missing } inserted. <inserted text> } l.724 }{} ! Display math should end with $$. <to be read again> \@@par l.724 }{} ! Extra }, or forgotten \endgroup. \par ...m \@noitemerr {\@@par }\fi \else {\@@par } \fi l.724 }{} ! Missing $ inserted. <inserted text> $ l.724 }{} ! Missing $ inserted. <inserted text> $ l.724 }{} ! Missing } inserted. <inserted text> } l.724 }{} ! Extra }, or forgotten \endgroup. \par ...m \@noitemerr {\@@par }\fi \else {\@@par } \fi l.724 }{} ! LaTeX Error: Bad math environment delimiter. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... * checking PDF version of manual without hyperrefs or index ... ERROR edd at max:/tmp/creel$ Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
Dirk Eddelbuettel
2015-Jan-04 00:05 UTC
[Rd] Potential cross-platform package building issue
Steven, Your error goes away when you write your \deqn{} in one line: \deqn{\widehat{R_1} = \frac{\sum\limits_{i=1}^n{c_i/n}}{\sum\limits_{i=1}^n{L_i/n}}} [...] \deqn{\widehat{E} = T\sum\limits_{i=1}^n{\frac{1}{w_{i}}}\sum\limits_{j=1}^m{\frac{e_{ij}}{\pi_{j}}}} The quoted text here still has the silly ^M at the end as I didn't bother converting your files from your somewhat OS-specific encoding. The combination of splitting a \deqn{} over several lines seems to be the issue. You may notice that the Writing R Manual example itself uses the latex trick of a trailing '%' before a line-break. The odd line end convention Windows seems more of a distration than an issue -- and if you work with a suitable editor you won't have to worry about either way. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
On 03/01/2015 6:53 PM, Dirk Eddelbuettel wrote:> > On 3 January 2015 at 13:49, Steven Ranney wrote: > | I am using 32-bit R 3.1.2 on Windows 7. > | > | I recently conducted an `R CMD check --as-cran` on a recently-developed > | package and received only the 'New submission' note. Research on > | StackOverflow and on R-devel suggested this could be ignored. I also used > | devtools::build_win() and received no notes or warnings, other than the one > | mentioned previously. Lastly, I conducted an `R CMD check` with the > | development version of R. Further, I built the package locally with `R CMD > | build` and `R CMD INSTALL --build` and everything worked as it should, > | including the PDF manual. > | > | Upon submission to CRAN, I was told that a warning was thrown: > | > | This fails to make its manual: > | * checking PDF version of manual ... WARNING > | LaTeX errors when creating PDF version. > | This typically indicates Rd problems. > | LaTeX errors found: > | ! Missing $ inserted. > | <inserted text> > | $ > | l.682 }{} > | ! Missing } inserted. > | <inserted text> > | } > | l.682 > | }{} > | ... > | > | The line appears to be > | \widehat{R_1} > | \frac{\sum\limits_{i=1}^n{c_i/n}}{\sum\limits_{i=1}^n{L_i/n}} > | > | I asked for assistance in resolving this issue as I could not replicate the > | WARNING. Another user could replicate the warning on Ubuntu 12.04 but was > | able to resolve the issue by removing the DOS end-of-line markers (^M or > | Ctrl-M) from the .Rd file. Neither he nor I could find anything in the R > | Extensions Manual that discussed removing end-of-line markers. > | > | Link to the thread on StackOverflow.com: > | http://stackoverflow.com/questions/27756679/cran-finds-an-warning-that-r-cmd-check-as-cran-does-not > | > | Link to GitHub repository: http://www.github.com/stevenranney/creelSurvey > | > | Is this an obscure cross platform issue? If so, I would have thought that > | someone else would have already discovered this. If this is normal > | behavior, is there a simple way to remove these end of line markers so I > | can minimize WARNINGS from CRAN in the future? > > Given that you pointed to a GH repo, I quickly fetched it as a zip archive. > This looks like a vanilla tex coding issue to me:But Steven didn't write any tex, R did. I do think the problem is with the CR/LF line endings. I think the first error comes from this line in man/SimulateBusRoute.Rd: \deqn{^M \widehat{R_1} \frac{\sum\limits_{i=1}^n{c_i/n}}{\sum\limits_{i=1}^n{L_i/n}}^M }^M (Those ^M's are really CR characters.) This is translated by R to \deqn{ \widehat{R_1} \frac{\sum\limits_{i=1}^n{c_i/n}}{\sum\limits_{i=1}^n{L_i/n}} }{} and I think those extra blank lines are causing the problem. The \deqn macro is defined as \newcommand{\deqn}[2]{\[#1\]} and the \[ for display equations doesn't like the blank lines. Generally R is good at reading text input in a variety of formats, but in this context it doesn't. (Since the input might be in some weird encoding, it doesn't fix up the line endings.) Steven should save his files with Unix-style line endings, and R should have told him to do this (or should have done it automatically when it built the tarball.) Duncan Murdoch> > * checking PDF version of manual ... WARNING > LaTeX errors when creating PDF version. > This typically indicates Rd problems. > LaTeX errors found: > ! Missing $ inserted. > <inserted text> > $ > l.682 }{} > > ! Missing } inserted. > <inserted text> > } > l.682 }{} > > ! Display math should end with $$. > <to be read again> > \@@par > l.682 }{} > > ! Extra }, or forgotten \endgroup. > \par ...m \@noitemerr {\@@par }\fi \else {\@@par } > \fi > l.682 }{} > > ! Missing $ inserted. > <inserted text> > $ > l.682 }{} > > ! Missing $ inserted. > <inserted text> > $ > l.682 }{} > > ! Missing } inserted. > <inserted text> > } > l.682 }{} > > ! Extra }, or forgotten \endgroup. > \par ...m \@noitemerr {\@@par }\fi \else {\@@par } > \fi > l.682 }{} > > ! LaTeX Error: Bad math environment delimiter. > > See the LaTeX manual or LaTeX Companion for explanation. > Type H <return> for immediate help. > ... > ! Missing $ inserted. > <inserted text> > $ > l.724 }{} > > ! Missing } inserted. > <inserted text> > } > l.724 }{} > > ! Display math should end with $$. > <to be read again> > \@@par > l.724 }{} > > ! Extra }, or forgotten \endgroup. > \par ...m \@noitemerr {\@@par }\fi \else {\@@par } > \fi > l.724 }{} > > ! Missing $ inserted. > <inserted text> > $ > l.724 }{} > > ! Missing $ inserted. > <inserted text> > $ > l.724 }{} > > ! Missing } inserted. > <inserted text> > } > l.724 }{} > > ! Extra }, or forgotten \endgroup. > \par ...m \@noitemerr {\@@par }\fi \else {\@@par } > \fi > l.724 }{} > > ! LaTeX Error: Bad math environment delimiter. > > See the LaTeX manual or LaTeX Companion for explanation. > Type H <return> for immediate help. > ... > * checking PDF version of manual without hyperrefs or index ... ERROR > edd at max:/tmp/creel$ > > Dirk >
On 03/01/2015 3:49 PM, Steven Ranney wrote:> I am using 32-bit R 3.1.2 on Windows 7. > > I recently conducted an `R CMD check --as-cran` on a recently-developed > package and received only the 'New submission' note. Research on > StackOverflow and on R-devel suggested this could be ignored. I also used > devtools::build_win() and received no notes or warnings, other than the one > mentioned previously. Lastly, I conducted an `R CMD check` with the > development version of R. Further, I built the package locally with `R CMD > build` and `R CMD INSTALL --build` and everything worked as it should, > including the PDF manual. > > Upon submission to CRAN, I was told that a warning was thrown: > > This fails to make its manual: > * checking PDF version of manual ... WARNING > LaTeX errors when creating PDF version. > This typically indicates Rd problems. > LaTeX errors found: > ! Missing $ inserted. > <inserted text> > $ > l.682 }{} > ! Missing } inserted. > <inserted text> > } > l.682 > }{} > ... > > The line appears to be > \widehat{R_1} > \frac{\sum\limits_{i=1}^n{c_i/n}}{\sum\limits_{i=1}^n{L_i/n}} > > I asked for assistance in resolving this issue as I could not replicate the > WARNING. Another user could replicate the warning on Ubuntu 12.04 but was > able to resolve the issue by removing the DOS end-of-line markers (^M or > Ctrl-M) from the .Rd file. Neither he nor I could find anything in the R > Extensions Manual that discussed removing end-of-line markers.I've looked more closely at the file: it doesn't have either Unix or DOS end-of-line markers, it has CR-CR-LF (or 0D 0D 0A in hex), and that's what confused R. Unix uses LF, DOS used CR-LF, but nobody uses CR-CR-LF. I've seen things like that caused by auto-conversion of files, so maybe Github did this to you. (The R sources all use LF, so that's the safest choice, but CR-LF should work fine too.) The likely reason that Linux systems detected the error while your Windows systems didn't is because the LaTeX systems handle these line endings differently. So I think this has to be classed as user error. Duncan Murdoch> > Link to the thread on StackOverflow.com: > http://stackoverflow.com/questions/27756679/cran-finds-an-warning-that-r-cmd-check-as-cran-does-not > > Link to GitHub repository: http://www.github.com/stevenranney/creelSurvey > > Is this an obscure cross platform issue? If so, I would have thought that > someone else would have already discovered this. If this is normal > behavior, is there a simple way to remove these end of line markers so I > can minimize WARNINGS from CRAN in the future? > > Thanks - > > Steven Ranney > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >