From huber at ebi.ac.uk  Tue Aug  5 23:05:47 2008
From: huber at ebi.ac.uk (Wolfgang Huber)
Date: Tue, 05 Aug 2008 22:05:47 +0100
Subject: [Rd] Adding .PDF files to a package
In-Reply-To: <EC8E181B-8CED-4AB4-8483-8786E9D5A852@rensenieuwenhuis.nl>
References: <EC8E181B-8CED-4AB4-8483-8786E9D5A852@rensenieuwenhuis.nl>
Message-ID: <4898C0AB.6090606@ebi.ac.uk>

Rense Nieuwenhuis wrote:
> Deal all,
> 
> new as I am to developing packages for R-Project, I apologize on 
> beforehand for questions that are too obvious. I am trying to 'add' a 
> PDF document containing some detailed information to a package.
> 
> The way I understand the Rexts.pdf document, I should add my .PDF 
> document to the /inst/doc/ folder, and links to the files should be 
> build automatically. However, after building it on MacOSX (10.4) using 
> 'R CMD build' and checking it using 'R CMD check', no links seems to be 
> present. All checks are OK, but no vignette or whatever appears in the 
> help-files of the package.
> 
> Clearly, I'm missing something. I would really appreciate some pointers 
> on how to integrate an 'additional' pdf file to my package.
> 
> Thanks in advance,
> 
> Rense Nieuwenhuis

Hi Rense

This is probably not the prettiest solution, and I'd be curious about 
better ones from people on this list, but here's one possibility:

1.) Put your PDF file foo.pdf into the inst/pdfs folder of your package.

2.) Create a file foo.Rnw with following content in inst/doc

------------------------------------------
%\VignetteIndexEntry{The Foo Bar}
\documentclass{article}
\begin{document}
\end{document}
------------------------------------------

3.) Create a Makefile in inst/doc, with contents like:

---------------------------------------
all: foo bar

bar: bar.tex
	pdflatex bar
	pdflatex bar

foo: foo.tex
	cp -p ../pdfs/foo.pdf .
---------------------------------------



Bw
Wolfgang

----------------------------------------------------
Wolfgang Huber, EMBL-EBI, http://www.ebi.ac.uk/huber



[Rd] Adding .PDF files to a package
Wolfgang Huber