user3652621
user3652621

Reputation: 3634

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?

Upvotes: 5

Views: 3612

Answers (3)

tonppeli
tonppeli

Reputation: 11

Here is quick'n'dirty rpm spec file for those who do not want to install non-packaged files to /usr.

    Name: texlive-rstudio-addon-el6
    Version: 0.1
    Release:        1%{?dist}
    Summary: addon stylesheets for Rstudio pandoc
    Group:  Publishing
    License: LPPL1.3c+
    URL: http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/
    Source0: http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/ifluatex.dtx
    Source1: http://mirrors.ctan.org/macros/latex/contrib/framed.zip
    BuildRequires:  texlive
    BuildRequires:  texlive-texmf
    BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
    BuildArch:      noarch


    %description
    Couple styles addons which are required by RStudio pandoc when processing Rmarkdown documents

    %prep
    %setup -q -c -T
    cat %{SOURCE0} > ifluatex.dtx
    unzip %{SOURCE1}

    %build

    %install
    rm -rf %{buildroot} && mkdir -p %{buildroot}
    tex ifluatex.dtx
    mkdir -p %{buildroot}/%{_texmf_main}/tex/generic/oberdiek
    mkdir -p %{buildroot}/%{_texmf_main}/tex/latex/
    cp ifluatex.sty %{buildroot}/%{_texmf_main}/tex/generic/oberdiek
    cp -a framed %{buildroot}/%{_texmf_main}/tex/latex/

    %clean
    rm -rf %{buildroot}

    %post
    [ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null


    %files
    %defattr(-,root,root)
    %{_texmf_main}/tex/generic/oberdiek/ifluatex.sty
    %{_texmf_main}/tex/latex/framed/*

    %doc
    %changelog

Upvotes: 1

Stuber
Stuber

Reputation: 477

For my fix root was needed and ifluatex and frame file permissions needed to be updated.

Upvotes: 0

user3652621
user3652621

Reputation: 3634

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.

Upvotes: 11

Related Questions