[R-SIG-Mac] building a package on a Mac: pdflatex
Martin Ellis
martin.ellis at gmail.com
Tue Jul 5 16:11:54 CEST 2011
On 5 July 2011 15:00, Federico Calboli <f.calboli at imperial.ac.uk> wrote:
> On 5 Jul 2011, at 14:48, David Winsemius wrote:
>
>> On Jul 5, 2011, at 9:10 AM, Federico Calboli wrote:
>>
>>> Simon,
>>>
>>>> both are entirely irrelevant - run
>>>> system("pdflatex --version")
>>>> in R - that is the only thing that counts. If it shows an error, then you don't have pdflatex on your PATH which would be the problem. As a side note, you are showing two separate TeX packages which may not help you to find out what breaks in your setup in general ...
>>>
>>>
>>> thanks for the hint. Unfortunately:
>>>
>>> system("pdflatex --version")
>>> /bin/sh: pdflatex: command not found
>>>
>>> doing a simple
>>>
>>> PATH=$PATH:/user/texbin
>>>
>>> fixed it if I use R and package.skeleton() from the terminal. If I use the R gui (from the standard R 2.13.0 CRAN download) it still does not find pdflatex and does not build a usable package skeleton.
>>>
>>> In any case, your hit solved my issue. Now, how do I set the path for the R gui?
>>>
>>
>> When the answer to this is posted, I am wondering if it could be put in the Mac R FAQ because it seems that I have read several questions of late that involve users puzzling where to set various paths for Finder, bash, and R that are stored in different places/environments. It would be good not to need to search for a r-sig-mac posting but rather refer to a "central document".
>
>
> As a matter of completeness, PATH=$PATH:/user/texbin did not alter my path 'globally', and immediately broke in a new terminal tab.
>
> I solved the issue globally with
>
> sudo sh -c 'echo "/usr/texbin">>/etc/paths.d/texbin' [the reader should be warned I use bash by default on my terminal]
>
> which does work if I use R in a terminal and I call system('pdflatex --version'). This solution also allowed a perfectly clean R CMD check.
Another way to do this would be to change the PATH variable in your
~/.bashrc (or other shell-specific startup file).
>
> On the other hand, from the GUI [R.app GUI 1.40 (5751) x86_64-apple-darwin9.8.0],
>
>> system("pdflatex --version")
> /bin/sh: pdflatex: command not found
I think what you want here is Sys.setenv() in R, e.g.,:
Sys.setenv(PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin")
You should be able to set this in your ~/.Rprofile
Cheers,
Martin
>
> bw
>
> F
>
>
>
>
>
> Federico C. F. Calboli
> Department of Epidemiology and Biostatistics
> Imperial College, St. Mary's Campus
> Norfolk Place, London W2 1PG
>
> Tel +44 (0)20 75941602 Fax +44 (0)20 75943193
>
> f.calboli [.a.t] imperial.ac.uk
> f.calboli [.a.t] gmail.com
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
More information about the R-SIG-Mac
mailing list