Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R documentation, how to force Rcmd Rd2pdf to automatically break an overfull line in examples R-like section?

My package passed Rcmd check successfully. but in constructed PDF format of R documentation, within the examples section, half of the line (R code) is out of the paper. I also found another CRAN submitted package, ftsa , that suffer from overfulling in a line too, see ftsa Reference manual.

I guess this problem roots in the behavior of the verbatim environment in Latex. However there are some Latex packages to deal with this, https://tex.stackexchange.com/questions/14342/verbatim-environment-that-can-break-too-long-lines, but I do not know how to use them with Rcmd.

  1. In dealing with these cases, why Rcmd check does not show any error, warnings or note as Latex does?
  2. How can I force line breaking in examples section?

Thank you

like image 590
Ehsan Masoudi Avatar asked Feb 25 '13 21:02

Ehsan Masoudi


1 Answers

  1. R CMD check does not analyze / forward all LaTeX warnings. Yes, in an ideal world it would.

  2. It has been the case, always that you should format the \examples{ ... } section well, yourself, notably including sensible line breaks (and leading spaces) for nice alignment of multi -line examples.

    Use the sources of R itself or recommended packages (or those authored by me, as I do pay attention to this quite a bit), to see good examples in their *.Rd files.

Remember: The current development sources of R are always web accessible at R (devel) source tree @ svn.r-project.org, i.e. R's standard packages at R sources src/library.

like image 97
Martin Mächler Avatar answered Sep 29 '22 15:09

Martin Mächler