# Remove\begin{Schunk} \begin{Sinput}

I am using Sweave to produce my tex. In addition I use lstlisting to highlight the source code as below.

\begin{lstlisting}[caption={Computation $\widehat Y_4$ and its Residue},label=list:5computationYpredict,captionpos=b]
\begin{Schunk}
\begin{Sinput}
> options(width = 80, continue = " ", size = "scriptsize")
> formula(mdl)
\end{Sinput}
\end{Schunk}
\end{lstlisting}


Is this possible to skip the \begin{Schunk}, \begin{Sinput}, \end{Sinput}, and \end{Schunk} from the output of the lstlisting? I need output as follows:

> options(width = 80, continue = " ", size = "scriptsize")
> formula(mdl)


after compile the tex.

Thanks

Satria

-

\documentclass{minimal}
\usepackage{listings}
\begin{document}

\begin{lstlisting}[linerange=\\begin\{Sinput\}-\\end\{Sinput\},includerangemarker=false]
\begin{Schunk}
\begin{Sinput}
> options(width = 80, continue = " ", size = "scriptsize")
> formula(mdl)
\end{Sinput}
\end{Schunk}
\end{lstlisting}

\end{document}

-
Thanks, It works. –  Satria Jan 31 '11 at 7:08
Sorry to keep nagging, Herbert, but again I think that one or two sentences of explanation would be great. –  Hendrik Vogt Jan 31 '11 at 13:26