[Rd] Maths in R documentation (PR#523)

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Tue, 18 Apr 2000 09:00:41 +0200 (MET DST)


>>>>> "Martyn" == Martyn Plummer <plummer@iarc.fr> writes:

    Martyn> The document R-exts contains the following example of using 
    Martyn> mathematics in R documentation.

    Martyn> \deqn{p(x) = {\lambda^x\ \frac{e^{-\lambda}}{x!}}
    Martyn>      {p(x) = lambda^x exp(-lambda)/x!}

    Martyn> There is a syntax error in there, but that's not my point.
    Martyn> The problem is that using "R CMD Rd2dvi" I find that putting
    Martyn> the alternate forms of the equation on top of each other doesn't
    Martyn> work.

    Martyn> \deqn{foo}
    Martyn>      {bar}

    Martyn> is interpreted as

    Martyn> \deqn{foo}
    Martyn> bar

yes.

The typo is simply a missing "%" at the end of the first line
(which once was there, and "of course" was dropped when that documentation
 was translated from latex to texinfo ...)

The following is correct

 \deqn{foo}%
      {bar}

(see e.g. src/library/base/man/Special.Rd or ...../symnum.Rd )

I'll fix R-exts.texi.

    Martyn> which causes a number of problems,e.g. you get both forms of the
    Martyn> equation printed, LaTeX complains about missing math delimiters, etc.
    Martyn> I solved this by putting everything on one line:

    Martyn> \deqn{foo}{bar}

    Martyn> but there is either a documentation error in there, or a
    Martyn> problem with parsing ".Rd" format files.

    Martyn> Another problem is that when I type "R CMD Rd2dvi coda" to get
    Martyn> a printable reference for all the functions in the coda
    Martyn> package, they seem to come out in a more or less random
    Martyn> order. I get read.bugs, mcmc, plot.mcmc, codamenu,
    Martyn> read.and.check,...  I was expecting alphabetical order. What do
    Martyn> I have to do to get this?

The change just been proposed yesterday by Doug Bates:

Replace in R..../bin/Rd2dvi , about line 88

	files=`find ${dir} -name "*.[Rr]d" -print`
by
	files=`find ${dir} -name "*.[Rr]d" -print | sort`


    Martyn> --please do not edit the information below--

    Martyn> Version:
    Martyn> platform = i686-unknown-linux
    Martyn> arch = i686
    Martyn> os = linux
    Martyn> system = i686, linux
    Martyn> status =
    Martyn> major = 1
    Martyn> minor = 0.1
    Martyn> year = 2000
    Martyn> month = April
    Martyn> day = 14
    Martyn> language = R

    Martyn> Search Path:
    Martyn> .GlobalEnv, Autoloads, package:base

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._