From edd at debian.org  Sun Jan  4 00:53:02 2015
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sat, 3 Jan 2015 17:53:02 -0600
Subject: [Rd] Potential cross-platform package building issue
In-Reply-To: <CANDt99qftMTV9+-DEmi-9WUT1bQknzT+wCTxVFHBsWPU15OYCQ@mail.gmail.com>
References: <CANDt99qftMTV9+-DEmi-9WUT1bQknzT+wCTxVFHBsWPU15OYCQ@mail.gmail.com>
Message-ID: <21672.32990.619412.259184@max.nulle.part>


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



[Rd] Potential cross-platform package building issue
Dirk Eddelbuettel