devtools::build_manual() and texinfo on RHEL7

I have gone down a rabbithole troubleshooting this so hoping that you folks may be able to quickly unblock me.

All I need to do is to run devtools::build_manual() to generate a pdf manual for an internal R package. This runs fine on my laptop but I need to run it on a Server Pro instance that’s running on a RHEL7 machine.

devtools::build_manual() is currently failing with error "Running 'texi2dvi' on 'Rd2.tex' failed." and message "sh: /usr/bin/texi2dvi: No such file or directory", with final error "Error in running tools::texi2pdf()".

?tools::texi2pdf() advises the following "A shell script texi2dvi is part of GNU's texinfo. Several issues have been seen with released versions, so if yours does not work correctly try R_TEXI2DVICMD=emulation." I have tried setting that as an option but the same error as above is persisting (as if this option is being overridden or not picked up).

Finally I considered yum installing the texinfo-tex rpm. In googling this I noticed a number of links related to installations of R. We of course installed R on this machine via RStudio's rpms (RStudio Install R - RStudio Documentation). I figured that texinfo may be baked into this RPM and something may be wrong with my environment?
Before I hack any further in manually installing texinfo, I wanted to reach out as this seems like a pretty basic bug with a feature that should be pretty standard for Server Pro and devtools users.


How did you set R_TEXI2DVICMD? It is surprising that it did not have any effect.

Do you have a TeX distribution installed on your system? You will need that, which is why the texinfo-tex RPM depends on various texlive RPMs. However, these are pretty outdated (RHEL7 is old ...), so it might make sense to install a more recent TeX Live (either using the TeX Live installer or via TinyTeX).

Thanks for the reply, I can look into the TeX options further. The use of RHEL7 is outside of my control, unfortunately.

In terms of the emulation option though, I have a .Rprofile within my R project which is loading the option each time I create a new session. I have tried setting only R_TEXI2DVICMD and also setting both that and texi2dvi
It has been failing for me with both variations.
Variation 1:

Variation 2:

Open to advice if you have any other thoughts on the emulation approach?

R_TEXI2DVICMD is an environment variable which is used to define the option texi2dvi, c.f.

I am not sure if devtools::build_manual() starts a new process and therefore forgets about the option you set. What happens if you call tools::texi2dvi() on a LaTeX file directly after setting the texi2dvi option? Most likely it will error out because there is no latex command, but at least this would be a different error message.

Appreciate the reply, Ralf.
Apologies for the slow reply, I missed the notification for your latest message.

In terms of the immediate blocker, it was time sensitive so I chose the path of least resistance and generated the pdf on my laptop.

Regarding the emulation option, I would be interested in troubleshooting further if you have any further suggestions.
Below is the output when attempting texi2dvi with emulation.

No problem.
So as expected, we see a warning that latex is missing. This gives us several possibilities:

In principle you could install TinyTeX also at the user level (the default), but then every user would have to do that.

Anyway, once latex is available via one of the above approaches, texi2dvi() in emulation mode should work. Of course, you could also install the texinfo-tex RPM to get the texi2dvi command. Just keep in mind to install CTAN: /tex-archive/support/texlive/texlive-dummy/EnterpriseLinux-7 if you used on of the latter two approaches. Otherwise texinfo-tex would bring in TeX Live from Centos 7 in addition to your manual installation.

I had originally presumed that the emulation flag would be enough and negate the need for a tex install, thanks for the advice.

I had a go installing TinyTex and CTAN: /tex-archive/support/texlive/texlive-dummy/EnterpriseLinux-7.

This is sufficient to run tools::texi2pdf() with the texi2dvi = emulation but seems that the issue here lies in the R_TEXI2DVICMD option persisting.

devtools::build_manual() continues to seek /usr/bin/texi2dvi.
I don't feel that I've exhausted troubleshooting this but I've reached the end of the day so wanted to check back in case it's quick feedback from you. Is it viable to troubleshoot getting this to work with TinyTeX or is it better to revert to option 1 and try an older TeX Live version?

I see a few possibilities:

  • With the texlive-* emulation package in place, you could simply install the texinfo-tex RPM w/o the need to install the old TeX Live. This would give you a proper texi2dvi.
  • You can set the environment variable R_TEXI2DVICMD in multiple places, c.f. 5 R Sessions | RStudio Server Professional Edition 1.4.1106-5 on a per server basis.
  • You can set the environment variable R_TEXI2DVICMD in RHOME/etc/ on a per R version basis or in ~/.Renviron on a per user basis.
  • You can set the option texi2dvi in RHOME/etc/ on a per R version basis or in ~/.Rprofile on a per user basis.

I would probably install the texinfo-tex RPM.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.