Hello,
recently I read about the SweaveListingUtils package and now I want to try
it out. However, I can not make it work...

Below a minimal example. The problem seems to be the following line
(generated by SweaveListingPreparations()?):

\ifthenelse{\boolean{swe...@gin}}{\setkeys{gin}{width=0.6\textwidth}}{}%

If I comment out this line, it works.

What can I do about this?

I am using the \begin{Scode} notation instead of Rnw files. May this be the
problem? For some technical reason, I would like to stick on this notation.

Any help appreciated,

kind regards,
Karsten.

%%%% begin example

\documentclass[9pt]{beamer}

\usepackage{fancyvrb}
\usepackage{listings}

% choose language and char set
\usepackage[ngerman]{babel}
\usepackage[ansinew]{inputenc}
%

\SweaveOpts{prefix.string=Routput/parcel, keep.source=TRUE}

\begin{Scode}{results=tex, echo=FALSE}
require(SweaveListingUtils)
SweaveListingoptions(intermediate = FALSE)
SweaveListingPreparations()
\end{Scode}


\begin{document}


\begin{frame}[fragile]
\frametitle{Your title}

\begin{lstlisting}options(digits=3)
set.seed(1)

require(Hmisc)

age <- rnorm(1000,50,10)
sex <- sample(c('female','male'),1000,TRUE)
out <- histbackback(split(age, sex), probability=TRUE, xlim=c(-.06,.06),
                    main = 'Back to Back Histogram')

#! just adding color
barplot(-out$left, col="red" , horiz=TRUE, space=0, add=TRUE, axes=FALSE)
barplot(out$right, col="blue", horiz=TRUE, space=0, add=TRUE, axes=FALSE)
\end{lstlisting}
\end{frame}

\begin{Scode}{echo=FALSE}
  unloadNamespace("SweaveListingUtils")
\end{Scode}

\end{document}

%%%%% end example

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to