[R] Off-Topic: LaTeX package listings
MSchwartz at MedAnalytics.com
Mon Oct 4 05:37:32 CEST 2004
On Sun, 2004-10-03 at 21:26, Kjetil Brinchmann Halvorsen wrote:
> 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:
> X %*% V
> in the output the * in %*% disappears! same with %/%, etc, the /
> Any ideas?
That's because the "%" is a comment character in LaTeX. Thus, anything
after it will be ignored.
For program code, you generally want to use the 'verbatim' or
X %*% V
In the verbatim environment, all characters are treated literally,
rather than interpreted by any special meaning.
Outside of that, say in a regular LaTeX document, you can escape the
More information about the R-help