From murdoch.duncan at gmail.com  Wed Dec  1 19:38:46 2010
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Wed, 01 Dec 2010 13:38:46 -0500
Subject: [Rd] Reordering entries in package manual PDF's
In-Reply-To: <4FEBB24215A35547BC21FAB42479B21F06B4FE69E8@cscexmb01.csc.local>
References: <4CF63F20.5030803@csc.fi>, <4CF645F5.4050301@gmail.com>,
	<4FEBB24215A35547BC21FAB42479B21F06B4FE69E7@cscexmb01.csc.local>
	<4FEBB24215A35547BC21FAB42479B21F06B4FE69E8@cscexmb01.csc.local>
Message-ID: <4CF69636.7060900@gmail.com>

On 01/12/2010 12:25 PM, Aleksi Kallio wrote:
> Hi again,
>
> And sorry for the spam.
>
> >  So now the output I'm getting is "good enough". I would still like to reorder functions so that they appear in a more logical order, so if anyone has ideas, please share!
>
> Newer R versions also add an index page at the end. In my case it is obsolete, so ideas on how to get rid of it are appreciated.
>
> A pointer to an in-depth technical description of the manual generation process would help, as hacking these kinds of things would be probably quite easy. So far I have not been able to Google anything relevant.

You could look at R Internals for such a thing, but you wouldn't find 
it.  (That manual tends to cover lower level issues.)

Generally in a case like this you need to go to the source code.  First, 
get a copy, then figure out what happens.  Here are the steps:

1. Download the full source from 
http://cran.r-project.org/src/base/R-2/R-2.12.0.tar.gz (or from a 
mirror), and untar it.

2. We use R CMD Rd2dvi to get the output we want.  Looking in 
src/scripts, you can see that the Rd2dvi script does some argument
cleaning, then runs tools:::..Rd2dvi().

3.  Look in src/library/tools/R for the file containing the source to 
..Rd2dvi(); you'll find it in Rd2dvi.R.

You can also see deparsed versions just by printing the tools:::..Rd2dvi 
function, but they may not be as useful as the original source.

I hope that helps.

Duncan Murdoch



[Rd] Reordering entries in package manual PDF's
Duncan Murdoch