From r.hankin at noc.soton.ac.uk  Thu Sep 21 11:05:42 2006
From: r.hankin at noc.soton.ac.uk (Robin Hankin)
Date: Thu, 21 Sep 2006 10:05:42 +0100
Subject: [Rd] typesetting a matrix in an Rd file
Message-ID: <F3DE250A-1D28-4A16-9A4D-038BB206F4B6@soc.soton.ac.uk>

Hello everybody

I'm trying to write an Rd file so that the resulting LaTeX-ed document
includes a matrix.

Here is the line in question:

\deqn{
   E_\theta\left(
   \begin{array}{cc}
       1 & x\theta\\
       x\theta & x^2\theta^2
       \end{array}\right)
       }{ommitted: see dvi}

which looks OK to me; the contents of the first curly brace
produce the desired matrix in a regular .tex file.

But it doesn't produce the desired matrix when included
in an Rd file: on my system the ampersands show up
literally, and the whole equation is on one line. I
suspect that the backslashes and ampersands are
being escaped somehow, and TeX isn't interpreting
them as desired.

How do I write an Rd file so that the output of R CMD Rd2dvi
includes a nicely typeset matrix?


--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743




[Rd] typesetting a matrix in an Rd file
Robin Hankin