[R] seeking latex peace

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun May 25 17:09:00 CEST 2014


On 25/05/2014 12:34, peter dalgaard wrote:
>
> On 25 May 2014, at 12:56 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
>> On 25/05/2014, 6:17 AM, Jim Lemon wrote:
>>> Hi all,
>>> I realize that this is not an R question, but in attempting to build a new
>>> version of a package, I have encountered the error:
>>>
>>> Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  :
>>>    pdflatex is not available
>>>
>>> As I could not find any way to install pdflatex (it didn't appear on a yum
>>> search), I tried a method that claimed to install pdflatex via a package
>>> named "texlive". Almost 300 packages later and minus over 300 Mb of
>>> disk space, I then got the error:
>>>
>>> ! LaTeX Error: File `zi4.sty' not found.
>>>
>>> This seems to be an updated version of the "inconsolata.sty" error that
>>> used to torment me (and after reading a lot of messages about this,
>>> many other people as well), so I found the file "zi4.sty" and copied it into
>>> what I thought was the appropriate directory. It seems to be, as I now get
>>> the error:
>>>
>>> ! LaTeX Error: File `upquote.sty' not found.
>>>
>>> At this point, I wonder if someone would be kind enough to inform me
>>> whether this is a potentially infinite task of finding ".sty" files, in which
>>> case I will live without them, or if there is an easier method of satisfying
>>> the apparently immense appetite of LaTeX? Thanks.
>>
>> I don't use TeXLive, but most LaTeX distributions offer a way to automatically install packages as needed.

I don't believe many do.  See 
http://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages .

>> But if you can't find it, you can just install them one by one:  it's not actually an infinite task.  I believe there are only about 4700 packages on CTAN (the equivalent of CRAN for TeX, in fact I believe it was the first C*AN). At 5 minutes per attempt, you'll be done in a couple of weeks!
>>
>
> However, before you do that, do check that your friendly distribution maintainers haven't already made things available by making pdflatex and friends a dependency of an R-devel (or so) meta-package.
>
> I'm getting a bit rusty on Fedora, but as far as I recall, you can "yum search" for packages that contain a specific .sty file.  In general, try to use the yum discipline when installing; it is so much easier to get things done right that way than it is to maintain your own texmf tree and/or mucking around in a system-installed one.

This is OK if your distribution is not a few years behind the times, 
which in the case of texlive, some are.

If you install R from the sources it will adapt to the LaTeX packages it 
finds, and you can set R_RD4PDF to customize afterwards.

Section A.1 of the 'R Installation and Administration manual' says

  A number of LaTeX packages are required (including url.sty, and 
listings.sty) and others such as hyperref and inconsolata are desirable 
(and without them you may need to change R’s defaults: see Making the 
manuals).

But it seems listings.sty is not needed for most packages.

I am guessing this is package plotrix.  To check that package I need

(/usr/local/texlive/2013/texmf-dist/tex/latex/base/ifthen.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/tools/longtable.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/tools/bm.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/alltt.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/tools/verbatim.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/url/url.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/textcomp.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/psnfss/times.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/inconsolata/inconsolata.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/keyval.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/color.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/infwarerr.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/hyperref.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/ifxetex/ifxetex.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/auxhook.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty
) (/usr/local/texlive/2013/texmf-dist/tex/latex/base/makeidx.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/inputenc.sty
(/usr/local/texlive/2013/texmf-dist/tex/latex/upquote/upquote.sty
  (/usr/local/texlive/2013/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/gettitlestring.sty

Of those, only url, inconsolata, hyperref and its dependants and upquote 
are non-standard, and upquote is required by that version of inconsolata.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list