[R] latex{Hmisc} cannot find xdvi on MAC OS X

Kevin E. Thorpe kevin.thorpe at utoronto.ca
Thu Jan 24 14:29:51 CET 2008


Kevin E. Thorpe wrote:
> Charles C. Berry wrote:
>> On Wed, 23 Jan 2008, Kevin E. Thorpe wrote:
>>
>>> Frank E Harrell Jr wrote:
>>>> Charles C. Berry wrote:
>>>>> On Wed, 23 Jan 2008, Frank E Harrell Jr wrote:
>>>>>
>>>>>> Kevin E. Thorpe wrote:
>>>>>>> Kevin E. Thorpe wrote:
>>>>>>>> Gabor Grothendieck wrote:
>>>>>>>>> It eliminates Hmisc and R by giving you a tex file.  Now its up
>>>>>>>>> to you to figure out how to handle tex files on your system.
>>>>>>>> I have suggested the student try options(xdvicmd="fullpathtoxdvi")
>>>>>>>> to see what happens.
>>>>>>> Here is the result of trying the above.
>>>>>>>
>>>>>>>> latex(describe(ps1d))
>>>>>>> This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
>>>>>>>  %&-line parsing enabled.
>>>>>>> entering extended mode
>>>>>>> (/tmp/RtmpMi0s95/file10d63af1.tex
>>>>>>> LaTeX2e <2005/12/01>
>>>>>>> Babel <v3.8h> and hyphenation patterns for english, usenglishmax,
>>>>>>> dumylang, noh
>>>>>>> yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak,
>>>>>>> german, ng
>>>>>>> erman, danish, esperanto, spanish, catalan, galician, estonian,
>>>>>>> farsi,
>>>>>>> finnish,
>>>>>>>  french, greek, monogreek, ancientgreek, croatian, hungarian,
>>>>>>> interlingua, ibyc
>>>>>>> us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk,
>>>>>>> polish, por
>>>>>>> tuguese, pinyin, romanian, russian, slovenian, uppersorbian, serbian,
>>>>>>> swedish,
>>>>>>> turkish, ukenglish, ukrainian, loaded.
>>>>>>> (/usr/local/texlive/2007/texmf-dist/tex/latex/base/report.cls
>>>>>>> Document Class: report 2005/09/16 v1.4f Standard LaTeX document class
>>>>>>> (/usr/local/texlive/2007/texmf-dist/tex/latex/base/size10.clo))
>>>>>>> (/usr/local/texlive/2007/texmf-dist/tex/latex/setspace/setspace.sty
>>>>>>> Package: `setspace' 6.7 <2000/12/01>
>>>>>>> ) (/usr/local/texlive/2007/texmf-dist/tex/latex/ltxmisc/relsize.sty)
>>>>>>> (/usr/local/texlive/2007/texmf-dist/tex/latex/geometry/geometry.sty
>>>>>>> (/usr/local/texlive/2007/texmf-dist/tex/latex/graphics/keyval.sty)
>>>>>>> (/usr/local/texlive/2007/texmf-dist/tex/xelatex/xetexconfig/geometry.cfg))
>>>>>>>
>>>>>>>
>>>>>>> No file file10d63af1.aux.
>>>>>>> [1] [2] (./file10d63af1.aux) )
>>>>>>> Output written on file10d63af1.dvi (2 pages, 10000 bytes).
>>>>>>> Transcript written on file10d63af1.log.
>>>>>>> /usr/texbin/xdvi: line 1: kpsewhich: command not found
>>>>>>> /usr/texbin/xdvi: line 46: exec: xdvi-xaw.bin: not found
>>>>>>>
>>>>>>>
>>>>>>> So, it appears to that something about the MAC environment is
>>>>>>> not being passed to the shell that is invoked when latex() is
>>>>>>> called in this way.
>>>>>> That's exactly what it looks like.  Shame on Mac "-)
>>>>>>
>>>>>> On my linux systems xdvi is in /usr/bin
>>>>> On my leopard, it is in /usr/texbin (as seen above) and
>>>>>
>>>>>     Sys.setenv( PATH=paste(Sys.getenv("PATH"),"usr/texbin",sep=":") )
>>>>>
>>>>> allows
>>>>>     system("xdvi")
>>>>>
>>>>> and
>>>> Excellent.  I much prefer solutions to workarounds.  A .profile or
>>>> .bashrc type of file can also extend the PATH this way.
>>>>
>>>> Thanks Chuck
>>>> Frank
>>> My student tried this but had the same result (failed) result.
>>>
>> What exactly is 'this'?
>>
>> The Sys.setenv() command or the .profile/.bashrc approach?
> 
> Sorry, I should have been explicit. It was the Sys.setenv() command.
> 
>> What does
>>
>>   list.files( tail( strsplit(Sys.getenv("PATH"),":" )[[1]],1))
>>
>> reveal after 'this' is done?
>>
>> I get
>>
>>   [1] "T1Wrap"              "a2ping"              "afm2pl"
>>   [4] "afm2tfm"             "aleph"               "allcm" [deleted]
>> [109] "kpsepath"            "kpsereadlink"        "kpsestat"
>> [112] "kpsetool"            "kpsewhere"           "kpsewhich"
>> [115] "kpsexpand"           "lacheck"             "lambda"
>> [more deleted]
>>
>> If s/he does not get something very much like the above after
>> Sys.setenv, then either s/he mistyped the Sys.setenv() line, or
>> something is different (wrong?) in his/her local setup.
>>
>> HTH,
>>
>> Chuck
>>
> 
> I will obtain the information you have requested from her.
> 
> Thank you for your help.  It IS appreciated.
> 
> Kevin
> 
>> p.s. FWIW
>>
>>> latex(describe(as.data.frame(diag(10))))
>> seems to run just fine iff I run the Sys.setenv() as above. I do have to
>> zoom out, 'though.
>>
> 
> 

I was comparing what my student did with what was posted for the
Sys.setenv() (which agree) and I noticed that the initial /
is missing from "usr/texbin"

Kevin

-- 
Kevin E. Thorpe
Biostatistician/Trialist, Knowledge Translation Program
Assistant Professor, Department of Public Health Sciences
Faculty of Medicine, University of Toronto
email: kevin.thorpe at utoronto.ca  Tel: 416.864.5776  Fax: 416.864.6057



More information about the R-help mailing list