Skip to content
Prev 44581 / 398503 Next

Sweave not found from MikTeX?

On Fri, 20 Feb 2004 09:53:31 +0100 Henrik Bengtsson wrote:

            
If I want to send the resulting TeX files to someone else, e.g., a
journal, then I usually just put the necessary declarations into the
header of the .Rnw (and resulting TeX) file:

-------------

\documentclass{article}
\usepackage{foo,bar}

%% instead of \usepackage{Sweave}
\RequirePackage[T1]{fontenc}
\RequirePackage{graphicx,ae,fancyvrb}
\IfFileExists{upquote.sty}{\RequirePackage{upquote}}{}
\setkeys{Gin}{width=0.8\textwidth}
\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{}
\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl}
\newenvironment{Schunk}{}{}

\begin{document}
...

-------------

When calling Sweave() it looks whether you already have included some
Sweave.sty into your document and only adds a line like
  \usepackage{path/to/Sweave.sty}
if you haven't. It doesn't mind that the line itself is escaped via %%.

Best,
Z