[R] Off-Topic: LaTeX package listings

Toby Popenfoose
Mon, 04 Oct 2004 09:25:02 -0000

Kjetil Brinchmann Halvorsen <kjetil <at> acelerate.com> writes:

>
> Hola!
>
> I ask here since I learnt from this list that the LaTeX package listings
> should be good
> for typesetting R code. I encountered one problem:
> \begin{lstlisting}
>       X %*% V
> \end{lstlisting}
>
> in the output the * in %*% disappears! same with %/%, etc, the /
> disappears.
>
> Any ideas?
>
> Kjetil
>

I use the following and it displays fine

\lstset{numbers=left, stepnumber=5,breaklines=true}
\lstset{basicstyle=\footnotesize,frame=single}
\lstset{language=R}

This is a test
\begin{lstlisting}
X in %*% V
%%
\end{lstlisting}

HTH