35

On ubuntu 14.04 with texlive, checking an R package, for example with devtools check() would return :

LaTeX errors found:
! LaTeX Error: File `inconsolata.sty' not found.

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

! Emergency stop.
<read *> 

l.276 ^^M

!  ==> Fatal error occurred, no output PDF file produced!
cmbarbu
  • 4,354
  • 25
  • 45
  • @Pascal this first lead to downloading inconsolata.sty from the CTAN which is a bad idea, specially if all you want is having R packages to built without errors – cmbarbu Jan 02 '16 at 12:54
  • I never suggested this. Just install a Latex distribution. –  Jan 02 '16 at 13:09
  • The `inconsolata` package is bundled in the LaTeX distribution [TinyTeX](https://yihui.org/tinytex/). You may consider uninstalling texlive and installing TinyTeX instead. – Yihui Xie Sep 23 '20 at 14:05

6 Answers6

42

Installing texlive-fonts-extra should take care of it.

You can also (though probably not recommented) tell Rd not to use inconsolata. Just change:

\DeclareOption{inconsolata}{\setboolean{Rd@use@inconsolata}{true}}

to

\DeclareOption{inconsolata}{\setboolean{Rd@use@inconsolata}{false}}

in your Rd.sty file. On my installation it is at :

/usr/share/R/share/texmf/tex/latex/Rd.sty

but a

locate Rd.sty

should find it on any system.

cmbarbu
  • 4,354
  • 25
  • 45
  • 2
    Thanks for the second solution (changing Rd.sty)! incosolate is like 1.7GB and I was on an airport wifi! – user189035 Mar 03 '17 at 14:44
  • 2
    Install the debian package `texlive-fonts-extra` does also solve the reported problem on Ubuntu 18.04.02 (just successfully done) – R Yoda Mar 13 '19 at 22:19
  • 9
    absolutely insane i'm installing 1.7Gb of whatever just to get a font – MichaelChirico Apr 11 '19 at 08:25
  • 1
    Just went through the entire dependency list of `apt` packages _besides_ `texlive-fonts-extra` to see if there is some subset of packages that would work. No! `texlive-fonts-extra` would appear to be minimal – MichaelChirico Jun 15 '20 at 06:15
15

I'm on macOS using Homebrew and this worked for me:

# LaTeX tools like pdflatex
brew cask install basictex

# Install texlive packages needed to build R package vignettes
sudo tlmgr update --self
sudo tlmgr update --all
sudo tlmgr install titling framed inconsolata
sudo tlmgr install collection-fontsrecommended
Kamil Slowikowski
  • 4,184
  • 3
  • 31
  • 39
  • 1
    Works in macOS Mojave for R-4.0.2 – f0nzie Sep 09 '20 at 21:16
  • 1
    Note that basictex needs to be added to PATH before the command `tlmgr` is available (your equivalent of `export PATH=/usr/local/texlive/2022basic/bin/universal-darwin/:$PATH`) – Serenthia Jun 30 '22 at 16:08
4

In Debian, instead of installing the huge texlive-fonts-extra package, run this at your shell:

tlmgr install inconsolata
updmap-user
Farid Cheraghi
  • 847
  • 2
  • 12
  • 23
  • Do that (`updmap-user`) may conduct to other errors (see https://tex.stackexchange.com/a/609807/8639), so I believe it is better to install `texlive-fonts-extra` or maybe other ways to install `inconsolata.sty` (https://tex.stackexchange.com/a/1138) – iago Aug 06 '21 at 20:39
3

If you are using the Travis Continuous Integration service, your problem could be related to the CTAN mirrors having yet to update.

The issue appears in the Travis R community forum:

might be related to the recent switch to TexLive-2019 as the LaTeX package manager seems to fail finding inconsolata in the repository.

...

It looks to me like the mirror chosen was has not updated to 2019, so I think this will resolve itself naturally when the mirrors catch up. If not I can look into it.

In the meantime, I solved it by forcing a previous version of TeXLive with a downgrade to OSX 10.12 in .travis.yml:

# macOS 10.12 version
osx_image: xcode9.2

See this Travis page for the correspondence between XCode and OSX versions and the original thread in DevOps StackExchange.

miguelmorin
  • 5,025
  • 4
  • 29
  • 64
1

I have Mac OSx and the accepted solution didn't work to me.

This was the solution in my case, to install mactex: https://tug.org/mactex/mactex-download.html

Pablo Casas
  • 868
  • 13
  • 15
1

tlmgr gave me a warning about a checksum. However this worked

  1. get inconsolata.tds.zip from https://ctan.org/pkg/inconsolata
cd /usr/share/texmf/
sudo unzip  inconsolata.tds.zip 
sudo mktexlsr
  1. I have had this problem every time I upgrade R. I agree the 1.7GB texlive-fonts-extra is ridiculous for a small file, although I understand that it does give you a choice of several Klingon fonts

this is for texLive on Ubuntu