Math & ScienceLaTeX Error: File 'Sweave.sty' not found

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
christophchk
Posts: 3
Joined: Sun Jun 03, 2012 5:20 pm

LaTeX Error: File 'Sweave.sty' not found

Post by christophchk »

Hi everybody!

Trying to learn Sweave. As far as I understood I´ve to write a Rnw-file, named it "Learn_Sweave.Rnw".

Code: Select all

> Sweave("Learn_Sweave.Rnw") in R
produced:

Code: Select all

Writing to file Learn_Sweave.tex
Processing code chunks with options ...
 1 : keep.source term tex
You can now run (pdf)latex on ‘Learn_Sweave.tex’
However, opening the ‘Learn_Sweave.tex’ with TeXnicCenter and trying to tex produced the well known:
!LaTeX Error: File 'Sweave.sty' not found.
The problem pops up in several forum-discussions - tried the proposed solutions, ended in the middle of nowhere.

I would be very thankful for helpful comments,

Christoph

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

LaTeX Error: File 'Sweave.sty' not found

Post by localghost »

Since »Sweave« is not an official package listed on CTAN, you have to get it from the net and integrate that file into your TeX installation. The search engine of your choice will surely help in this regard (keyword »sweave.sty«).


Best regards and welcome to the board
Thorsten
christophchk
Posts: 3
Joined: Sun Jun 03, 2012 5:20 pm

Re: Sweave | Beginner Problems

Post by christophchk »

Thx a lot - found a Sweave.sty file,

saved it in

C:\Programme\MiKTeX 2.8\tex\latex\base

which was NOT a good idea, leading to the same error.
How do I find out where to save it in my directory?

Apologies for my naiveté,

Christoph
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

LaTeX Error: File 'Sweave.sty' not found

Post by localghost »

Placing the package file directly into the MiKTeX installation path is not a good idea. The MiKTeX Documentation describes in detail how to add local additions [1]. The important thing to do is to refresh the File Name Database (FNDB) via MiKTeX Options (in the »Start« menu), probabaly with administrator rights.

[1] MiKTeX Documentation – Integrating Local Additions
christophchk
Posts: 3
Joined: Sun Jun 03, 2012 5:20 pm

Re: Sweave | Beginner Problems

Post by christophchk »

Got it!!!

Many thanks & cordial greetings,

Christoph
Post Reply