Here is the full repair for the latex functions in Hmisc to make pdflatex
work in Windows.
This version is still slightly awkward.  I hope that Charles and Frank will
smooth it out
and put it in their next release.

I added two new options() and revised show.dvi so it will use them.

Rich



library(Hmisc)

show.dvi <-
function (object, width = 5.5, height = 7)
{
    viewer <- optionsCmds("xdvi")
    cmd <- if (viewer == "yap") {
        paste(viewer, object$file)
    }
    else if (viewer == "kdvi") {
        paste(viewer, object$file)
    }
    else if (viewer == "xdvi") {
        paste(viewer, " -paper ", width, "x", height, "in -s 0 ",
            object$file, sep = "")
    }
    else if (basename(viewer) == "AcroRd32") {
      object$file <- sub("dvi", "pdf", object$file)
        paste(viewer, object$file)
    }
    else {
        paste(viewer, object$file)
    }
    system(cmd, intern = TRUE, wait = TRUE)
    invisible(NULL)
}
environment(show.dvi) <- environment(print.dvi)

options(latexcmd="pdflatex",
        xdvicmd="c:/Progra~1/Adobe/Reader~1.0/Reader/AcroRd32")

x <- matrix(1:24, 6,4, dimnames=list(letters[1:6], LETTERS[1:4]))
show.dvi(dvi(x.tex <- latex(x)))
paste(getwd(), x.tex$file, sep="/")  ## location of the table itself
## The tex file with headers and the pdf file are in the directory
## given in the printed output from dvi().

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to