[Rd] Possible bug in the Rd parser?

Mathieu Ribatet mathieu.ribatet at epfl.ch
Sat Oct 10 14:07:42 CEST 2009

Dear list,

I got an automatic email complaining than some of my packages didn't
pass 'R CMD check' for R-2.10.0 alpha anymore. Both of them make use of
the "cases" LaTeX environment.

Inspecting the log outputs I got:

        LaTeX errors when creating PDF version.
        This typically indicates Rd problems.
        LaTeX errors found:
        ! Misplaced alignment tab character &.

I noticed that the Rd parser changed quite recently and that '#', '_'
and '&' must not be escaped according to "Writing R extensions".
However, the problematic .Rd portion seems (to me) OK

        \deqn{\theta(h) =
            u_\beta \left(\mu +  \frac{\nu(h)}{\Gamma(1 - \xi)}
        \right),&\xi \neq 0\\
            \exp\left(\frac{\nu(h)}{\sigma}\right),&\xi = 0
          }{u_beta (mu + nu(h) / Gamma(1 - \xi)), if \xi < 1,
            exp(nu(h)/sigma), otherwise}

Removing the alignment tab character '&' solves the issue but doesn't
produce the expected LaTeX output. Do I miss something with the new Rd
parser requirements?

I'm not 100% sure but it also seems like that "\\' symbol isn't
interpreted as a break line - in the "cases" environment at least. This
might be one reason why the alignment tab '&' is misplaced.


Institute of Mathematics
Ecole Polytechnique Fédérale de Lausanne
CH-1015 Lausanne   Switzerland
Tel: + 41 (0)21 693 7907

More information about the R-devel mailing list