2

I am trying to make Sweave.sty and Rd.sty globally available on my system. After reading related posts on StackExchange, I changed texmf.cnf, so that

kpsewhich --expand-var='$TEXMF'

results in

{/home/philipp/texmf,!!/etc/texmf,!!/var/lib/texmf,!!/usr/lib/texmf,!!/usr/local/share/texmf,!!/usr/share/texmf,/usr/lib64/R/share/texmf/tex/latex}

The last directory is where R puts Sweave.sty and Rd.sty, and I also tried the variant with

!!

before this path. After

sudo texhash

and (just to be certain)

sudo mktexlsr

appropriate ls-R files are created. Nevertheless

kpsewhich Sweave.sty

still does not find the file, even with the

--must-exist 

option. After trying all this I am stuck. I suspect there is some trouble because texlive and OpenSUSE are said not to mix well (especially when it comes to adding packages), but do not have the faintest clue.

Philipp
  • 213
  • you can make a symbolic link from R's directory to ~/texmf, then you do not need complicated configurations like you did – Yihui Xie May 18 '12 at 23:35
  • @Yihui I know that there are all sorts of workarounds. Your suggestion works in my case, since I am the only user. But nevertheless it does not explain why kpsewhich fails. – Philipp May 19 '12 at 05:45
  • 1
    I meanwhile figured it out: you must not add the full path to Sweave.sty to texmf.cnf. You must only add the path up to the texmf folder. So in my case it should have been: /usr/lib64/R/share/texmf/ instead of /usr/lib64/R/share/texmf/tex/latex. – Philipp May 19 '12 at 07:13
  • I suggest you add your comment as an answer and accept it, since it is actually the right way to do. By the way, you shouldn't leave a trailing slash: .../texmf rather than .../texmf/ since kpathsea will add /tex/latex which would result in a double slash texmf//tex/latex and double slashes happen to have a special meaning (search recursively) for kpathsea. – mpg May 20 '12 at 20:21

1 Answers1

2

I meanwhile figured it out: you must not add the full path to Sweave.sty to texmf.cnf. You must only add the path up to the texmf folder. So in my case it should have been: /usr/lib64/R/share/texmf instead of /usr/lib64/R/share/texmf/tex/latex

Philipp
  • 213