From rksh1 at cam.ac.uk  Tue Apr 28 13:30:31 2009
From: rksh1 at cam.ac.uk (Robin Hankin)
Date: Tue, 28 Apr 2009 12:30:31 +0100
Subject: [Rd] vignettes in a bundle
In-Reply-To: <49F6DE43.6090704@dbmail.com>
References: <49F6AAE4.4020305@cam.ac.uk> <49F6AE06.2090608@dbmail.com>
	<49F6BF08.7060800@cam.ac.uk> <49F6DE43.6090704@dbmail.com>
Message-ID: <49F6E8D7.4030904@cam.ac.uk>

Romain Francois wrote:
> Would this work better:
>
> <<echo=FALSE,results=tex>>=
> bib <- system.file( "doc", "bayesian.bib", package = "emulator" )
> cat( "\\bibliography{",bib,"}\n",sep='')
> @
>
> Romain

Yes, this gives cleaner TeX output (I keep on forgetting about Sweave's
'result' code chunk option).

But I still don't understand why your first suggestion worked.
How does TeX 'know' that this is not to be included verbatim?

best wishes and thanks again

Robin

>
> Robin Hankin wrote:
>> Hello Romain
>>
>> this is brilliant; it never occurred to me to use cat() in this way.
>>
>> It works but I don't know why.
>>
>> With:
>>
>> <<echo=FALSE>>=
>> bib <- system.file( "doc", "bayesian.bib", package = "emulator" )
>> cat( "\\bibliography{",bib,"}\n",sep='')
>> @
>>
>> in the Rnw file, the TeX file looks like this:
>>
>> \begin{Schunk}
>> \begin{Soutput}
>> \bibliography{/usr/local/lib/R/library/emulator/doc/bayesian.bib}
>> \end{Soutput}
>> \end{Schunk}
>>
>>
>> So, my question is: why does TeX parse the  middle line? why isn't this
>> line interpreted as regular Soutput?
>>
>> best wishes and thanks again
>>
>> Robin
>>
>>
>>
>> Romain Francois wrote:
>>> Hi Robin,
>>>
>>> Something like:
>>>
>>> <<echo=FALSE>>=
>>> bib <- system.file( "bib", "mybib.bib", package = "yada" )
>>> cat( "\\bibliography{",bib,"}\n")
>>> @
>>>
>>> It would also be nice to be able to use bibliography in Rd files ...
>>>
>>> Romain
>>>
>>> Robin Hankin wrote:
>>>> Hi
>>>>
>>>> I have a bundle comprising three packages.
>>>>
>>>> Each package has a vignette.  Currently each
>>>> vignette has a separate .bib file.
>>>>
>>>> How do I arrange the bundle so that each
>>>> vignette accesses a single, common, .bib file?
>>>>
>>>>
>>>> thanks
>>>>
>>>> Robin
>>>>
>>>
>>>
>>
>>
>
>


-- 
Robin K. S. Hankin
Uncertainty Analyst
University of Cambridge
19 Silver Street
Cambridge CB3 9EP
01223-764877



[Rd] vignettes in a bundle
Robin Hankin