Hi list, Excuse me b/c this is probably a more "TeX" then "R" question. I've been using "latex" function in my .Rnw file to generate tables, but I've always been using it without assigning the result to a object, i.e. x <- matrix(1:6, nrow=2, dimnames=list(c('a','b'),c('c','d','this that'))) latex(x) so, I always get the error window (attached) poped out. But since I can just click OK and everything seems fine except in my working directory I get a bunch of "junk" files (.log, .dvi, etc...), I've been ignoring it. Now I know by doing e.g. tmp <- latex(x) will suppress this error message, but I'm still curious on how to get rid of the error window when I just use latex(x). I read the "Example" section of "latex" help file and I tried to include the following into my PATH: "C:\Program Files\MiKTeX 2.7\tex\latex" but that didn't work. I'm using R.2.11.0, Hmisc 3.7, and MiKtex 2.7 on WinXP. Thanks! ...Tao
Shi, Tao wrote:> Hi list, > > Excuse me b/c this is probably a more "TeX" then "R" > question. > > I've been using "latex" function in my .Rnw file to > generate tables, but I've always been using it without assigning the > result to a object, i.e. > > x <- matrix(1:6, nrow=2, > dimnames=list(c('a','b'),c('c','d','this that'))) > latex(x) > > so, I always get the error window (attached) poped out. But since I can > just click OK and everything seems fine except in my working directory I get a bunch of "junk" files (.log, .dvi, etc...), I've been ignoring > it.Your attachment did not come through, most likely because it is not a type that is supported by the list.> > Now I know by doing e.g. tmp <- latex(x) will suppress > this error message, but I'm still curious on how to get rid of the error window when I just use latex(x). I read the "Example" section of > "latex" help file and I tried to include the following into my PATH: > > "C:\Program Files\MiKTeX 2.7\tex\latex"Well I can't directly help you with your issue, since I don't know what error you're receiving, the reason this is happening is that when you don't assign the result of your latex call, the function 'print.latex' is getting called, which if I understand tries to compile the LaTeX output and display the result in a suitable viewer. By assigning the results of the latex call in R, you stop this printing from happening. As for what your issue is, I don't know since your attachment did not come through.
Hi Tao, I think you just need latex(x, file="") Best, Ista On Wednesday 12 May 2010 3:18:42 pm Shi, Tao wrote:> Hi list, > > Excuse me b/c this is probably a more "TeX" then "R" > question. > > I've been using "latex" function in my .Rnw file to > generate tables, but I've always been using it without assigning the > result to a object, i.e. > > x <- matrix(1:6, nrow=2, > dimnames=list(c('a','b'),c('c','d','this that'))) > latex(x) > > so, I always get the error window (attached) poped out. But since I can > just click OK and everything seems fine except in my working directory I > get a bunch of "junk" files (.log, .dvi, etc...), I've been ignoring it. > > Now I know by doing e.g. tmp <- latex(x) will suppress > this error message, but I'm still curious on how to get rid of the error > window when I just use latex(x). I read the "Example" section of "latex" > help file and I tried to include the following into my PATH: > > "C:\Program Files\MiKTeX 2.7\tex\latex" > > but that didn't work. > > I'm > using R.2.11.0, Hmisc 3.7, and MiKtex 2.7 on WinXP. > > Thanks! > > ...Tao
Shi, Tao wrote:> so, I always get the error window (attached) poped out.The image was stripped by the mailer. Please type the text of the error into the body of the email.> I tried to include the following into my PATH: > > "C:\Program Files\MiKTeX 2.7\tex\latex" >Where? In the Windows environment on the Control Panel? Through R? What does R think the the path is? Sys.getenv("PATH") Does it have two backslash characters everywhere you only one backslash character? My R shows C:\\Program Files\\MiKTeX 2.7\\miktex\\bin;> but that didn't work. >Please define "didn't work". Include the full message that you received. Rich