2

I've been looking everywhere, but my computer (Windows 7) just won't install the Sweave.sty package for Miktex 2.9. I tried to put it in a folder respecting the TDS standard, and then to install it, locally. The Package Manager won't accept any folder I suggest as a local package repository

error: this folder doesn't seem to be a local repository.

I added the direction to the roots, but it just won't find the sweave.sty package. I updated the database several times, with the texhash prompt in the console, and using the button.

I tried to follow the instructions on: https://stat.ethz.ch/pipermail/r-help/2010-February/229033.html and http://docs.miktex.org/manual/localadditions.html

It always gives me the same error message:

Package Sweave could not be found.

On my other computer I have a local repository in the User folder, and I always have to put the directory of the Sweave file in the preamble of my document. At least, that works, but as I would like to keep my file reproducible, I would prefer to know how to properly install Sweave. Maybe its because I changed the basic directory shown in the console to the local folder where my LaTeX document is.

I use the WinEdt editor. Maybe it has something to do with Ghostscript, I have no idea whether this is installed or what it is used for. I try to find out about that next.

Can anyone give me a hint what to try next? I tried to be as precise as I could.

karlkoeller
  • 124,410

2 Answers2

3

I finally changed all my documents to knitr, now everything works fine, even if I lost a lot of time. My problem was not adding the roots to my database, but I didn't find out what it was. The Database updating worked out on the other computer, but my computer just won't install Sweave.

2

What I suggest is to create a local TEXMF tree in MiKTeX, for example in the directory C:\Local.

After that, create the path C:\Local\tex\latex\misc and copy Sweave.sty there.

At this point, open the admin version of MiKTeX Settings program, and, in the 'Roots' tab, press 'Add' and select the directory C:\Local. Now press 'OK' and MiKTeX automatically inserts C:\Local in the TDS as a local tree.

If you now add the line

\usepackage{Sweave}

in your document, Sweave is found by MiKTeX.

Moreover, since you are using WinEdt as your editor, I suggest you to download the R-Sweave add-on by Gilbert Ritschard that lets you use Sweave from within WinEdt (a very useful package). The version for WinEdt 7/8 also adds support for knitr, if you're interested in it.

karlkoeller
  • 124,410
  • I found and tried out this solution before. I swear I did what you said, it still won't work out. I found that solution in different blogs, too. It didn't work using link instead of link neither. I will, however, update my WinEdt version and install the addon. Then, I will try out knitr. – Angelika Jun 04 '13 at 21:20