[R] Hmisc & pdflatex

Duncan Mackay mackay at northnet.com.au
Tue Apr 23 05:27:30 CEST 2013


Hi

I have come late to the discussion

how about trying
? texi2dvi
for pdf or dvi eg

texi2dvi("D:/Cic/Sweave/Figs/Sheep3/FS/15/sFSheepFS15.tex", pdf = 
TRUE, clean = TRUE)

Version
R version 3.0.0 (2013-04-03), i386-w64-mingw32
Win 7
I made an environmental variable for Miktex in Windows or it was made 
on installation.

c:\Program Files\MikTex2.9\miktex\bin

I have had no problems

If you do not set a working directory it defaults to your R directory 
My Documents or whatever.

HTH

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mackay at northnet.com.au

At 10:37 23/04/2013, you wrote:
>Dear Rxperts..
>
>The problem of latex looking for "tex" and  "dvi" files in a "TEMP" folder
>still persists. As a work around, I changed the options..
>options(latexcmd="pdflatex",dviExtension="pdf")
>After the above change,
>
>latex(....,file="a1")
>
>seems to work but the resulting pdf file is something
>like..."file13207cb8d2c.pdf.
>When this file was created, "a1" tex tile, "file13207cb8d2c.aux" and "
>file13207cb8d2c.log" files were also created in the "current working"
>  folder.
>
>I still get the error message:
>
>Windows API error 2: The system cannot find the file specified:
>Data:
>C:\Users\santosh\ApptData\Local\Temp\RtmpeGaNYGi\file192183g543.pdf.dvi
>
>Looking eagerly forward to your suggestions.
>
>Regards,
>Santosh
>
>On Mon, Apr 22, 2013 at 1:27 PM, Santosh <santosh2005 at gmail.com> wrote:
>
> > Dear expeRts!
> > Thanks for suggestions about getting MiKTeX... I have that installed.. The
> > Sys.getenv("PATH") also reflects the path of "pdflatex"..
> >
> > I noticed that the function creates ".dvi", ".aux" files in the "current
> > working directory but looks for these files in Sys.getenv("TEMP") folder.
> > Is there away to make "latex"  point to the correct folder? I have similar
> > problems with other functions like texi2dvi.
> >
> > owd <- getwd()
> > setwd("../Tables")
> >
> >  latex(a1,output="test",file="t1.tex",here=T)
> >
> > This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit)
> > entering extended mode
> > (C:/Users/santosh/AppData/Local/Temp/RtmpeA78Zj/filefac46aa1ac3.tex
> > LaTeX2e <2011/06/27>
> > Babel <v3.8m> <deleted text>....loaded.
> > ("C:\Program Files\Latex\tex\latex\base\report.cls"
> > Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
> > ("C:\Program Files\Latex\tex\latex\base\size10.clo"))
> > ("C:\Program Files\Latex\tex\latex\geometry\geometry.sty"
> > ("C:\Program Files\Latex\tex\latex\graphics\keyval.sty")
> > ("C:\Program Files\Latex\tex\generic\oberdiek\ifpdf.sty")
> > ("C:\Program Files\Latex\tex\generic\oberdiek\ifvtex.sty")
> > ("C:\Program Files\Latex\tex\generic\ifxetex\ifxetex.sty")
> > ("C:\Program Files\Latex\tex\latex\geometry\geometry.cfg"))
> > No file filefac46aa1ac3.aux.
> > *geometry* driver: auto-detecting
> > *geometry* detected driver: dvips
> > ! Undefined control sequence.
> > l.5 \toprule
> >
> > ! Undefined control sequence.
> > <recently read> \midrule
> >
> > l.8 \midrule
> >
> > ! Undefined control sequence.
> > <recently read> \bottomrule
> >
> > l.24 \bottomrule
> >
> > [1] (.\filefac46aa1ac3.aux)
> > )
> > (see the transcript file for additional information)
> > Output written on filefac46aa1ac3.dvi (1 page, 1664 bytes).
> > Transcript written on filefac46aa1ac3.log.
> > Warning messages:
> > 1: running command 'C:\Windows\system32\cmd.exe /c cd
> > "C:\Users\santosh\AppData\Local\Temp\RtmpeA78Zj" & latex
> > -interaction=scrollmode
> > "C:\Users\santosh\AppData\Local\Temp\RtmpeA78Zj\filefac46aa1ac3"' had
> > status 1
> > 2: In shell(cmd, wait = TRUE, intern = output) :
> >   'cd "C:\Users\santosh\AppData\Local\Temp\RtmpeA78Zj" & latex
> > -interaction=scrollmode
> > "C:\Users\santosh\AppData\Local\Temp\RtmpeA78Zj\filefac46aa1ac3"' execution
> > failed with error code 1
> >
> >
> > On Mon, Apr 22, 2013 at 7:41 AM, Duncan Murdoch 
> <murdoch.duncan at gmail.com>wrote:
> >
> >> On 22/04/2013 10:34 AM, Santosh wrote:
> >>
> >>> Dear Rxperts,
> >>> Apologize for posting it to a wrong thread..Hence, the re-post...
> >>>
> >>> I am trying to use pdflatex from Hmisc, I get the error message.
> >>> "pdflatex
> >>> is not available"... The version of Hmisc is the latest one (got the
> >>> warning that it was compiled under R version 2.15.3) .
> >>>
> >>> The version of R on my machine is
> >>> > version
> >>>
> >>> platform       i386-w64-mingw32
> >>> arch           i386
> >>> os             mingw32
> >>> system         i386, mingw32
> >>>   status
> >>> major          2
> >>> minor          15.2
> >>> year           2012
> >>> month          10
> >>> day            26
> >>> svn rev        61015
> >>> language       R
> >>> version.string R version 2.15.2 (2012-10-26)
> >>>   nickname       Trick or Treat
> >>> >
> >>>
> >>> Is it not available anymore? I created a latex file using "tables"
> >>> package
> >>> and am unable to create the pdf file using pdflatex ... I am also not
> >>> able
> >>> to use Sweave with the above version of R as it is not available.
> >>>
> >>
> >> In this context, "not available" means not listed in your system PATH.
> >>  Use Sys.getenv("PATH") to get your current PATH; it will be a list of
> >> directories.  If none of those directories contain pdflatex.exe, then
> >> pdflatex is "not available".
> >>
> >> Duncan Murdoch
> >>
> >>
> >>> I also tried texi2dvi (from tools); and it says "latex is not available".
> >>> But,  I was earlier able to use "latex" with tabular to generate a "tex"
> >>> file. I am confused with such conflicting messages.
> >>>
> >>> Also.. when I tried to use latex again,
> >>>   latex(summ2,title=outfile,**file="a1.tex") # summ2 is a "tabular"
> >>> output
> >>> using "tables" package
> >>> 'latex' is not recognized as an internal or external command,
> >>> operable program or batch file.
> >>> Error in system(cmd, intern = TRUE, wait = TRUE) : 'yap' not found
> >>> In addition: Warning messages:
> >>> 1: running command 'C:\Windows\system32\cmd.exe /c cd
> >>> "C:\Users\santosh\AppData\**Local\Temp\RtmpsZ3tP9" & latex
> >>> -interaction=scrollmode
> >>> "C:\Users\santosh\AppData\**Local\Temp\RtmpsZ3tP9\**file13207cb8d2c"'
> >>> had
> >>> status 1
> >>> 2: In shell(cmd, wait = TRUE, intern = output) :
> >>>    'cd "C:\Users\santosh\AppData\**Local\Temp\RtmpsZ3tP9" & latex
> >>> -interaction=scrollmode
> >>> "C:\Users\santosh\AppData\**Local\Temp\RtmpsZ3tP9\**file13207cb8d2c"'
> >>> execution
> >>> failed with error code 1
> >>>
> >>>
> >>> Any suggestions welcome!
> >>> Thanks,
> >>> Santosh
> >>>
> >>>         [[alternative HTML version deleted]]
> >>>
> >>> ______________________________**________________
> >>> R-help at r-project.org mailing list
> >>> 
> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
> >>> PLEASE do read the posting guide http://www.R-project.org/**
> >>> posting-guide.html <http://www.R-project.org/posting-guide.html>
> >>> and provide commented, minimal, self-contained, reproducible code.
> >>>
> >>
> >>
> >
>
>         [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at 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.



More information about the R-help mailing list