[R-sig-Debian] How to set symbolic link correctly so that LaTeX finds Sweave?

Marius Hofert marius.hofert at math.ethz.ch
Fri May 25 18:57:35 CEST 2012


On 05/25/2012 05:35 PM, Dirk Eddelbuettel wrote:
>  On 25 May 2012 at 17:20, Marius Hofert wrote:
>  | I recently switched from Mac OS X (after 7 years) to Xubuntu 12.04 and I am
>  | quite happy with it so far. I first installed R from source but I was somehow
>  | missing certain things and I thus decided (after a new Xubuntu installation
>  | which I had to make due to other reasons) to install R the "Ubuntu way":
>
>  Right.

okay, good (I wasn't sure if it's the "correct" approach, that's why I
mentioned it here).

>
>  | ,----[ R installation: ]
>  | | 1) sudo emacs /etc/apt/sources.list
>  | | 2) add:
>  | |    debhttp://stat.ethz.ch/CRAN/bin/linux/ubuntu  precise/
>  | | 3) in a terminal:
>  | |    gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
>  | |    gpg -a --export E084DAB9 | sudo apt-key add -
>  | | 4) the "standard way":
>  | |    sudo apt-get update
>  | |    sudo apt-get install r-base
>  | |    sudo apt-get install r-base-dev
>  | |    sudo apt-get build-dep r-base-dev
>  | `----
>
>  'r-base-dev' should give you everything you need to use CRAN; the build-dep
>  are only needed if you build R from source, which you should not have to.

Martin Maechler suggested it at some point (we develop "copula") -- not
sure anymore why.

>  | I realized that the TeXLive Version which can be installed via the Ubuntu Software
>  | Center is quite outdated (2009) for my needs. I therefore installed TeXLive 2011
>  | like this:
>
>  "Doctor, doctor: it hurts when I do this."
>
>  "Well then don't do it."

:-)

In principle, I agree. However, there are certain things that are simply
not possible with older versions of software packages (due to
org-contacts for example, I need emacs-snapshot).

>  Well this is your problem.
>    On stock Debian and Ubuntu system with the
>  disto's versions of R and TeX, Sweave "just works".

Something I don't understand: I specified Sweave.sty (via the link) from
the 2009 basic TeXLive installation and it still did not work... (that's
why I wasn't sure I installed R/TeX correctly and that's why I gave the
information above).

>    If you choose to go
>  another route, you get to pick up the pieces yourself.
>
>  For the record:
>
>  edd at max:~$ dpkg -L r-base-core | grep Sweave.sty
>  /usr/share/R/share/texmf/tex/latex/Sweave.sty
(I didn't know this command, thanks).

I have the same output.

>  edd at max:~$ dpkg -L r-base-core | grep "tex/latex"
>  /usr/share/texmf/tex/latex
>  /usr/share/R/share/texmf/tex/latex
>  /usr/share/R/share/texmf/tex/latex/Sweave.sty
>  /usr/share/R/share/texmf/tex/latex/ts1aer.fd
>  /usr/share/R/share/texmf/tex/latex/omscmtt.fd
>  /usr/share/R/share/texmf/tex/latex/omsaett.fd
>  /usr/share/R/share/texmf/tex/latex/ts1aett.fd
>  /usr/share/R/share/texmf/tex/latex/omsaer.fd
>  /usr/share/R/share/texmf/tex/latex/jss.cls
>  /usr/share/R/share/texmf/tex/latex/Rd.sty
>  /usr/share/R/share/texmf/tex/latex/upquote.sty
>  /usr/share/texmf/tex/latex/R

Again, same output.

>  edd at max:~$ ls -l /usr/share/texmf/tex/latex
>  total 36
>  drwxr-xr-x 4 root root  4096 2011-11-18 11:39 beamer
>  drwxr-xr-x 2 root root 12288 2010-05-09 19:35 lm
>  drwxr-xr-x 9 root root  4096 2011-11-18 11:39 pgf
>  drwxr-xr-x 2 root root  4096 2011-05-14 09:06 preview
>  drwxr-xr-x 2 root root  4096 2010-05-06 23:26 prosper
>  lrwxrwxrwx 1 root root    22 2009-10-13 20:56 R ->   ../../../R/share/texmf
>  drwxr-xr-x 2 root root  4096 2010-05-06 23:34 tipa
>  drwxr-xr-x 2 root root  4096 2010-05-06 23:26 xcolor
>  edd at max:~$ ls -ld /usr/share/texmf/tex/latex
>
>  and that symlink which places the 'R' directory into texlive's default search
>  path is added by the R package I maintain.

Okay, so I try to achieve something similar by hand:

cd /usr/share/texmf/tex/latex
sudo ln -s /usr/share/R/share/texmf Sweave

Hmmm... still Sweave.sty not found (after texhash&  reboot) -- although
that's the tex tree of the 2009 TeXLive version.

For the 2011 TeXLive version, I tried the command I gave before -- still
without success. Unfortunately, the README of TeXLive 2011 does not tell
where the tex tree is it installs to. This would be helpful to determine
in which directory the symbolic link to /usr/share/R/share/texmk has to
be set.

Cheers,

Marius






>  Dirk
>



More information about the R-SIG-Debian mailing list