Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R cmd check not locating texi2pdf on mac after R 3.1.3 upgrade

Tags:

macos

r

texinfo

Does anyone have a link to clear instructions on how to install and configure the necessary latex packages to build R packages on a mac?

I have some scripts for building and checking R packages on a mac server. They seemed to work fine, but after upgrading to R 3.1.3, many of the packages started failing with

Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
  Running 'texi2dvi' on 'networkVignette.tex' failed.
Messages:
sh: /usr/local/bin/texi2dvi: No such file or directory
Calls: <Anonymous> -> texi2pdf -> texi2dvi
Execution halted

I found a thread which seemed to suggest I need a more recent version texinfo (5.2) than what is installed by default. And apparently I've I've got the wrong version installed in the wrong location?

which texi2pdf
/sw/bin/texi2pdf

texi2pdf --version
texi2pdf (GNU Texinfo 5.1) 5234

(same version is reported when running system('texi2pdf --version') in R )

This thread gives a link to a texinfo 5.2 source collection:

http://r.789695.n4.nabble.com/R-CMD-build-looking-for-texi2dvi-in-the-wrong-place-R-devel-td4701706.html

But I'm not familiar with installing executable from a tar.gz file on a mac. The R mac help pages I found suggest installing MacTex, which I tried but that didn't seem to help.


** Update: ** additional discussion of related problems on R-SIG-mac mailing list: https://groups.google.com/forum/#!topic/r-sig-mac/xjyuFdl5Ezk


Update: Here is where I'm currently at:

  1. I removed my /sw directory to uninstall fink and all of its packages (couldn't figure out how to upgrade it)

  2. installed homebrew

  3. brew install texinfo installs version 5.2 the package,

but generates the message This formula is keg-only, which means it was not symlinked into /usr/local and actually installs in in /usr/local/Cellar/texinfo/5.2/bin which means it is not on the path and R won't find it.

  1. manually symlink each of the texi2pdf, texi2dvi , etc as vincent suggests (this is because R has the /usr/local/bin location as default in the tools::texi2dvi function?

  2. edited the /etc/paths file on the system to add /usr/local/bin so that finds the brew installed 5.2 version before it finds it before the osx system supplied version 4.6 version. This may not be necessary because R has it hardcoded?

All of this gets rid of the "can't find texi* errors", and gives me a bunch of latex errors (which I don't see on unix and windows builds) so I'm still kind of stuck.

This seems very hackish, so there must be a cleaner way? But it sounds like stuff with tex and mac is very sketchy at the moment? https://tex.stackexchange.com/questions/208181/why-did-my-tex-related-gui-program-stop-working-in-mac-os-x-yosemite

like image 609
skyebend Avatar asked Oct 31 '22 08:10

skyebend


1 Answers

This worked for me on Mavericks and on Yosemite:

ln -s /usr/bin/texi2dvi /usr/local/bin/texi2dvi
ln -s /usr/bin/texi2pdf /usr/local/bin/texi2pdf
like image 110
Vincent Avatar answered Nov 15 '22 05:11

Vincent