[R] Off-Topic: LaTeX package listings

Toby Popenfoose tpopenfoose at earthlink.net
Mon Oct 4 11:25:02 CEST 2004


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




More information about the R-help mailing list