[R] table of contents link style in R's PDF docs

Ben Harrison harb at student.unimelb.edu.au
Thu Sep 26 05:38:27 CEST 2013


Hello,
I am mildly annoyed each time I use a PDF doc of an R package that the 
table of contents hyperlinks are *only* on the page numbers. To activate 
a hyperlink, one must carefully scan sideways from the text item wanted 
to the far right of the page and click on a tiny box. Multiply that mild 
annoyance by the large number of times I need to look up package help 
docs, and I find myself here writing this message.

 From my understanding (albeit poor), all of the R docs for packages are 
to be written in Rd format. From that they are converted by the 
functions in the tools package as required (to latex and PDF, or HTML, 
etc). So the only thing that controls in the PDF docs the hyperlinks one 
way or another is the latex style file used - in this case I believe it 
is Rd.sty (/usr/share/R/share/texmf/tex/latex/Rd.sty on my system).

Line 303 of that file contains the single setting of the \hypersetup{} 
command for whether or not the text in the table of contents is 
hyperlinked, or the page number:

     linktocpage,%

which causes it to implicitly be set to True. Setting it to false (or 
just commenting out that line I suppose as false is the default) would 
mean the *text* in the TOC is hyperlinked.

So, is the desired behaviour intended to be that only the page numbers 
are hyperlinked (and therefore to annoy me), or has no-one really 
bothered themselves with it that much, or something else?

Can I recreate all the documentation on my system after I make a change 
to Rd.sty?



More information about the R-help mailing list