Re: [Rd] Link to pdf documentation from other package ?

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Wed, 18 Nov 2009 08:22:11 -0500

On 11/18/2009 7:28 AM, Ulrike Grömping wrote:

> Duncan Murdoch schrieb:
>> Ulrike Groemping wrote:

>>>
>>> Duncan Murdoch-2 wrote:
>>>
>>>> Ulrike Groemping wrote:
>>>>
>>>>> Dear developeRs,
>>>>>
>>>>> I have not found anything recent about how to link to a vignette or
>>>>> other
>>>>> documentation from within Rd-files. Is this now possible with the new
>>>>> help
>>>>> system ? For example, I would like to link to the file AlgDesign.pdf
>>>>> provided within the doc directory of package AlgDesign.
>>>>>
>>>>>
>>>> Yes, you can do it with a \url{} macro. Use a relative link, acting
>>>> as though the starting page is located in
>>>> /library/AlgDesign/html/*. So \url{../doc/AlgDesign.pdf}
>>>> should work from the same package,
>>>> \url{../../AlgDesign/doc/AlgDesign.pdf} from elsewhere. Please let
>>>> me know if this doesn't work, I haven't tested.
>>>>
>>>> Duncan Murdoch
>>>>
>>>>
>>>
>>> Yes, this works, thanks! Is it also possible to display an
>>> alternative text
>>> instead of the URL itself, like with other links (e.g. show text
>>> "Open pdf"
>>> that operates the link) ?
>>>
>>>
>>
>> There's no optional text in the \url{} tag, but you could embed it in 
>> an \ifelse tag, e.g.
>>
>> \ifelse{html}{\url{ ....  }}{ [open pdf ...] }
>>
>> might work.  Using the \ifelse tag will make your package depend on R 
>> >= 2.10.0.
>>
>> Duncan Murdoch

>>>
> Another thought: the link only works, if the two packages are installed 
> in the same library, doesn't it ? Would there be a way to make it work 
> independently of this restriction ?

With dynamic help, it doesn't matter where they are installed. If you install the static HTML pages, then it matters.

Duncan Murdoch



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 18 Nov 2009 - 13:27:14 GMT

This archive was generated by hypermail 2.2.0 : Wed 18 Nov 2009 - 21:40:28 GMT