I would like to print some tables and figures to a PDF device on a CentOS 5 vps. However, I cannot seem to get the latex function from Hmisc working. I followed the example, and got an error: sh: xdvi: command not found. I tried installing the 'tetex-xdvi' linux package, and now it returns: Error: Can't open display. I guess the reason for this is that the machine is a VPS terminal, so it has no display, however I dont understand why it does not write to the PDF device. Some code:> pdf("test.pdf") > x <- matrix(1:6, nrow=2, dimnames=list(c('a','b'),c('c','d','this that'))) > latex(x) # creates x.tex in working directoryThis is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) entering extended mode (/tmp/Rtmp7bbXMN/file643c9869.tex LaTeX2e <2003/12/01> Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur kish, ukrainian, nohyphenation, loaded. (/usr/share/texmf/tex/latex/base/report.cls Document Class: report 2004/02/16 v1.4f Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size10.clo)) (/usr/share/texmf/tex/latex/geometry/geometry.sty (/usr/share/texmf/tex/latex/graphics/keyval.sty) (/usr/share/texmf/tex/latex/geometry/geometry.cfg)) No file file643c9869.aux. [1] (./file643c9869.aux) ) Output written on file643c9869.dvi (1 page, 372 bytes). Transcript written on file643c9869.log. Error: Can't open display: ----- Jeroen Ooms * Dept. of Methodology and Statistics * Utrecht University Visit http://www.jeroenooms.com www.jeroenooms.com to explore some of my current projects. -- View this message in context: http://www.nabble.com/-Hmisc--Latex-to-pdf-tp25316986p25316986.html Sent from the R help mailing list archive at Nabble.com.
Jeroen Ooms <j.c.l.ooms <at> uu.nl> writes: [...]> Output written on file643c9869.dvi (1 page, 372 bytes). > Transcript written on file643c9869.log. > Error: Can't open display:The can't open display-error rather looks like an X11-problem. Are you reglar user on that system ? Try to look at the dvi with your dvi-viewer. xdvi, kdvi or something like that. Ciao, Oliver
On 9/6/09, Jeroen Ooms <j.c.l.ooms at uu.nl> wrote:> I would like to print some tables and figures to a PDF device on a CentOS 5 > vps. However, I cannot seem to get the latex function from Hmisc working. I >There is also xtable() for transferring tables to LaTeX. Liviu
Hi Jeroen,> From: Jeroen Ooms <j.c.l.ooms at uu.nl> > To: r-help at r-project.org > Date: Sun, 6 Sep 2009 04:49:08 -0700 (PDT) > Subject: [R] [Hmisc] Latex to pdf > > I would like to print some tables and figures to a PDF device on a CentOS 5 > vps. However, I cannot seem to get the latex function from Hmisc working. I > followed the example, and got an error: sh: xdvi: command not found. I tried > installing the 'tetex-xdvi' linux package, and now it returns: Error: Can't > open display. I guess the reason for this is that the machine is a VPS > terminal, so it has no display, however I dont understand why it does not > write to the PDF device. Some code:Yep, the VSP terminal is likely causing the problem.> > > pdf("test.pdf")No, don't call latex() inside a pdf device like this. The latex() command produces a .tex file, which can then be processed by the system latex or pdflatex etc.> > x <- matrix(1:6, nrow=2, dimnames=list(c('a','b'),c('c','d','this that'))) > > latex(x) ? # creates x.tex in working directoryAnd what happens when you call "latex x.tex" from the system console or system("latex x.tex") from R? Does it work? You can avoid having the latex() function try to create and display the dvi by setting the file name: latex(x, file="abcThisThat.tex"). Hope it helps, Ista <snip> -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org> Jeroen Ooms * Dept. of Methodology and Statistics * Utrecht University > > Visit ?http://www.jeroenooms.com www.jeroenooms.com ?to explore some of my > current projects.