35

On a fresh install of TeXlive on a Linux box (Linux Mint 11) I get the following error message:

! LaTeX Error: File `scalefnt.sty' not found.

But the file is there:

$ find /usr/ -name 'scalefnt.sty'  -print
/usr/share/texmf-texlive/tex/latex/carlisle/scalefnt.sty

Why pdflatex did not find it? Is it a bug in the TeXLive installation process?

Until now I have solved this problem by adding lines like this one :

export TEXINPUTS=$TEXINPUTS:/usr/share/texmf-texlive/tex/latex/carlisle/

in my .bashrc file. Now I have 20+ such lines in my .bashrc. There must be a better way to solve this problem.

-- Update -- Running texhash did not solve the problem.

$ sudo texhash
[sudo] password :
texhash: Updating /usr/local/share/texmf/ls-R... 
texhash: Updating /var/lib/texmf/ls-R-TEXMFMAIN... 
texhash: Updating /var/lib/texmf/ls-R-TEXLIVE... 
texhash: Updating /var/lib/texmf/ls-R... 
texhash: Done.

I think the ls-R file in /usr/local/share/ was created by texhash. It is empty. I found in the kpathsea doc how to log : export TEXMFLOG=/tmp/texmf.log. After running pdflatex I get in the log :

$ cat /tmp/texmf.log 
1309254390 /var/lib/texmf/ls-R
1309254390 /usr/local/share/texmf/ls-R
1309254390 /usr/share/texmf/ls-R
1309254390 /usr/share/texmf-texlive/ls-R
1309254390 /var/lib/texmf/web2c/pdftex/pdflatex.fmt
1309254390 /usr/share/texmf-texlive/tex/latex/base/letter.cls
1309254390 /usr/share/texmf-texlive/tex/latex/base/letter.cls
1309254390 /usr/share/texmf-texlive/tex/latex/base/size10.clo
1309254390 /usr/share/texmf-texlive/tex/latex/base/size10.clo
1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.sty
1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.sty
1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.ldf
1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.ldf
1309254390 /usr/share/texmf-texlive/tex/generic/babel/babel.def
1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.cfg
1309254390 /usr/share/texmf-texlive/tex/generic/babel/frenchb.cfg 

In the texlive setup I use, the files /usr/share/texmf/ls-R and /usr/share/texmf-texlive/ls-R are links to /var/lib/texmf/ls-R-TEXMFMAIN and /var/lib/texmf/ls-R-TEXLIVE respectively.

I don't understand why it does not work since the style file is in one of the ls-R files:

$ grep scalefnt.sty /var/lib/texmf/ls-R-TEXLIVE
scalefnt.sty

This looks like a bug in the texlive package installation process (in Linux Mint/Ubuntu).

3
  • 6
    You definitely shouldn't need all those modifications to $TEXINPUTS. Have you tried running mktexlsr (texhash)? You should be able to do sudo texhash or sudo mktexlsr to rebuild the list of files. Does that solve the problem?
    – Alan Munn
    Jun 27, 2011 at 15:59
  • I met the same problem. But I occasionally found it in my case that I have to change the file permissions for .sty files. This could be the answer.
    – Yin
    Aug 24, 2012 at 21:12
  • I know this is an old thread, but I have just run into what looks like the same problem after doing a clean install of Ubuntu 12.04 and then installing texlive via apt-get. In my case it cannot find 'article.cls' but on running 'sudo latex test.tex' it works
    – Yemon Choi
    May 2, 2013 at 1:49

2 Answers 2

21

Modern TeX distributions use kpathsea library to find the files.

If your TeX Live cannot find the file, try to run texhash to refresh the file name database. On Linux / Mac, run sudo texhash.

5
  • 1
    Thanks to Alan & Leo. I tried both sudo texhash and sudo mktexlsr. I get the following output: mktexlsr: Updating /usr/local/share/texmf/ls-R... mktexlsr: Updating /var/lib/texmf/ls-R-TEXMFMAIN... mktexlsr: Updating /var/lib/texmf/ls-R-TEXLIVE... mktexlsr: Updating /var/lib/texmf/ls-R... mktexlsr: Done. But I continue to get the same error. Jun 27, 2011 at 22:15
  • 1
    @Davy_Crockett: It seems that you installed two TeX Live distributions: one is from Linux source (at /usr/share/), the other one is from TUG (at /usr/local/share/). You don't have scalefnt.sty in the TUG one (usr/local/share/...). Or maybe you wrongly installed TeX Live.
    – Leo Liu
    Jun 28, 2011 at 0:06
  • I updated the question because it did not fit in a comment. Jun 28, 2011 at 10:13
  • 3
    sudo texhash did the trick for me. Thanks for the tip!
    – user7823
    Sep 13, 2011 at 9:15
  • @Boris: I converted your answer to a comment. Instead of posting a “Thank you” as an additional answer, you should thank Leo by upvoting his answer (with the upward pointing arrow to the left of it; you need 15 reputation points before you can upvote). We want to keep the answer space reserved for actual answers.
    – Stefan Kottwitz
    Sep 13, 2011 at 13:32
1

What happened to me was: in Ubuntu 11.10 I defined the environment variable TEXMFCN to point at my home directory

$TEXMFCNF=$HOME/texmf/web2c

export TEXMFCNF

For some reason, after the upgrade to 14.04, the bash gave a different interpretation to my setting: to search the latex packages only in my home directory. So, commenting that line in .bashrc

# $TEXMFCNF=$HOME/texmf/web2c

# export TEXMFCNF

worked out for me. Defining the variable by including the paths to all the existing files texmf.cfn

$TEXMFCNF=/usr/share/texlive/texmf-dist/web2c:/usr/share/texmf/web2c:$HOME/texmf/web2c

export TEXMFCNF

also works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .