Search code examples
rknitrpandocrstudio-serverrhel6

Rstudio-server on RHEL 6.5 pandoc error ifluatex.sty not found


OS: RHEL 6.5 x64
Rstudio-server Version 0.98.1062
R version 3.1.1 (2014-07-10)
knitr version 1.6

When attempting to knit an Rmarkdown file I get a failure during the pandoc stage of the compilation:

pandoc: Error producing PDF from TeX source.
! LaTeX Error: File 'ifluatex.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.

Tried the (9-hour-long) full manual LiveTeX install, just to be sure, and luatex is now installed, but there is still no ifluatex.sty to be found. How do I tell RStudioServer/knitr/pandoc where the installation directory for that file is?


Solution

  • Many thanks to Homer White's blog for sending me in the right direction. I'm more or less posting his answer verbatim, with minor modifications for RHEL 6.5 and 2014 LiveTex.

    Even the full manual install had not solved the problem. Following Homer's advice, I downloaded from the internet a copy of ifluatex.sty You can get it either directly or via wget from the CTAN archive.

    wget http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/ifluatex.dtx
    tex ifluatex.dtx
    

    Copy the resulting file into the shared folder for your LaTeX Distribution. In RHEL 6/CentOS for the 2014 LiveTex distribution installed via install-tl this was:

    /usr/share/texmf/tex/generic/oberdiek
    

    Easy, right? Next step was to get the framed package:

    wget http://mirrors.ctan.org/macros/latex/contrib/framed.zip
    unzip framed.zip 
    

    This should create a folder in the download location. Now copy the entire folder to the Shared LiveTeX folder for LaTeX:

    /usr/share/texmf/tex/latex
    

    Finally, let LiveTeX know it should update its library by running

    texhash
    

    PS: Note that I had root access. You might need it as well, of if you're a wheel user, prefix with sudo.