R, how to get Rcmd Rd2pdf to automatically break a crowded line in examples of an R-like section?

My package successfully passed the Rcmd check . but in the constructed PDF of the R document in the examples section, half the line (R-code) is missing in the document. I also found another ftsa package passed to CRAN that also suffers from line overflow, see the ftsa Reference Guide .

I suggest that these are problematic roots in the behavior of the verbatim environment in latex. However, there are several Latex packages to solve this problem, 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 .

  • When considering these cases, why Rcmd check n't the Rcmd check show any errors, warnings, or notes, like latex does?
  • How to make a line break in the examples section?

thanks

+7
source share
1 answer
  • R CMD check does not parse / does not forward all LaTeX warnings. Yes, in an ideal world, that would be.

  • It is always the case that you should format the \ examples {...} section of yourself, especially , including reasonable line breaks (and leading spaces) for good alignment of multi-line examples.

    Use the sources of R itself or recommended packages (or created by me, as I pay attention to it quite a bit) to see good examples in your * .Rd files.

Remember: current R development sources are always available on the Internet at R (devel) source tree @ svn.r-project.org , i.e. standard R packages on R sources src / library .

+4
source

All Articles