1
votes

I would like to get the Latex source for the PDF that is built when executing

R CMD Rd2pdf /path/to/mypackage

for building the R package documentation. It would be very nice if I could get the documentation as a latex document such that I could easily include it in another latex document as an appendix and have a continuous page numbering.

I have only seen the possibility to compile the files one by one from .Rd to .tex: How to create R documentation file (.Rd) in latex?, which points to the function tools::Rd2latex and the question How do I convert Rd files to pdf for a package that I am creating in R? which points to the command

R CMD Rdconv -o x.tex --type=latex man/x.Rd

Both commands only work on single .Rd files. The created files lack the header/definitions. So I would have to sort and include each file manually in the final latex file. It would be nice if there is some way to get the latex document in a simpler way.

1
(you don't need the latex source to include the pdf with continuous page numbering, have a look at pdfpages package)samcarter_is_at_topanswers.xyz

1 Answers

1
votes

You can do:

R CMD Rd2pdf path/to/package/man --no-clean

In addition to the PDF file, this creates a folder containing the auxiliary files, including the tex source file.