In conjunction with trying to find a solution for myself in regards to this question, I find myself plunged into trying to write valid Rd markup. What I want is to add a section named Raw Function Code
and put the code of the function under it. I've achieved limited success in this regard by writing a script to modify the Rd files to include
\section{Raw Function Code}{\code{
# some piece of R script will eventally provide this part of the text
}}
However, even if I manually properly spaced text into the .Rd file (using either spaces or tabs), the initial white space of each line seems to get stripped away leaving an undesirable looking function. I've noticed that if I provide a starting character before the white space the white space is retained. However, I did not want to provide a starting character because I'd like people to be able to copy and paste directly from the produced PDF.
I have reviewed parseRd and I know there are three types of text LaTeX- like, R-like, and verbatim. I have tried to put my function code in \code and in \verb and neither seemed to yield the desired results. What can I do to hold onto my initial white space?
\begin{verbatim} ... \end{verbatim}
– Ingleside