44

I just installed TexLive on a i386 Ubuntu 12.04 LTS machine.

Now when I try to compile a TeX file I get following error message:

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

kpsewhich caption.sty gives

/usr/local/texlive/2013/../texmf-local/tex/latex/caption/caption.sty

I also tried installing caption with tlmgr but after doing that it doesn't work either.

The last thing I did was copy the contents of the usr/local/texlive/2013/texmf-dist/ folder to usr/local/texlive/texmf-local/ in hope that it maybe would work.

When i try to compile these are some of the lines that come before the error.

(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)

Does anybody know a solution to this?

luffer
  • 575
  • 4
    Sounds as if you have two tex systems on your PC. – Ulrike Fischer Feb 05 '14 at 13:08
  • may be first follow http://tex.stackexchange.com/questions/95483/how-to-remove-everything-related-to-tex-live-for-fresh-install-on-ubuntu and then go with http://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu – texenthusiast Feb 05 '14 at 13:57
  • How did you intall texlive? – Dox Feb 05 '14 at 14:29
  • i did download the install-tl-unx.tar.gz archive, unzipped it and executed the install-tl script in terminal. then it downloaded the whole thing (about 2700 items) – luffer Feb 05 '14 at 14:34
  • Did you add lines like this PATH=$PATH:/usr/local/texlive/2013/bin/x86_64-linux export PATH MANPATH=$MANPATH:/usr/local/texlive/2013/texmf/doc/man export MANPATH INFOPATH=$INFOPATH:/usr/local/texlive/2013/texmf/doc/info #export INFOPATH to your ~/.bashrc file? – Dox Feb 05 '14 at 14:44
  • You might try going to the directory containing the file caption.sty and running sudo ln -s caption.sty /usr/share/texmf-texlive/tex/latex/base/. && sudo mktexlsr && sudo texconfig rehash. – Greg Marks Jul 15 '15 at 00:53

2 Answers2

57

First suggestion would be, Check if the caption.sty file is somewhere on the system

$ locate caption.sty

If it is not installed, most probably the package is not on the basic configuration of texlive.

I used the command

$ apt-cache search caption | grep tex

and found the following packages

texlive-latex-recommended - TeX Live: LaTeX recommended packages
texlive-pictures - TeX Live: Graphics, pictures, diagrams
texlive-latex-extra - TeX Live: LaTeX additional packages
telxcc - Teletext closed captioning decoder

Install them,

$ sudo apt-get -y install texlive-latex-recommended texlive-pictures texlive-latex-extra

and try compiling again!

Friendly advise

If you have hard disk space to spare, I would recommend to install texlive-full, which contains all the packages of the texlive version on the repository. So you have less chance to have this type of problems.

If you install manually

Make sure you add the following lines to your ~/.bashrc file

PATH=$PATH:/usr/local/texlive/2013/bin/x86_64-linux
export PATH
MANPATH=$MANPATH:/usr/local/texlive/2013/texmf/doc/man
export MANPATH
INFOPATH=$INFOPATH:/usr/local/texlive/2013/texmf/doc/info
export INFOPATH

Cheers.

Dox
  • 5,729
  • 1
    But if you install texlive through the system-packagemanager, you normally don't get tlmgr, right? Also many systems have really old texlives. – Juri Robl Feb 05 '14 at 15:08
  • 1
    @JuriRobl I do have tlmgr! (Debian Sid, with texlive-full installed through the command line). However, I'm not sure if the old version in the Ubuntu repo has it! :-/ – Dox Feb 05 '14 at 16:34
  • Oh cool, I didn't get it the last time I installed it on Debian and Ubuntu. It was some time ago, though. – Juri Robl Feb 05 '14 at 16:49
  • @Dox: It worked. Although I don't know why. – luffer Feb 05 '14 at 17:49
  • @luffer I guess that you had texlive installed first from the repo. Therefore, when you installed a new version (manually), it's mandatory to add to the $PATH of binaries the new files (this include the newest LaTeX kernel, classes, styles, etc.). Additionally, the new installation has documentation in the for of manual and info pages... the path to those files should be include properly into the $MANPATH and $INFOPATH variables. – Dox Feb 05 '14 at 20:02
  • Thanks for the answer! I just had a last question, How this will change for Tex Studio? – L.K. Jul 19 '18 at 08:36
  • @L.K. In the post there is nothing related to the editor, but with the LaTeX installation. What do you exactly mean with changes in TexStudio? – Dox Jul 20 '18 at 08:32
  • It's counter-intuitive that you need to install other stuff to get texliveonfly to work. Isn't that the package's main selling point? – Sridhar Sarnobat Apr 11 '22 at 00:49
2

It would be better to install all the packages of texlive using the command:

    sudo apt-get install texlive-full 
Harshil
  • 103
ashwinjoseph
  • 137
  • 3
  • 7
    This is a huge amount of stuff, and normally, things should not break if you don't wish to download a full texlive installation. – Bubaya Mar 27 '19 at 14:42
  • Welcome to TeX.se. I'm having trouble understanding your last sentence. Did you mean to say "As once you get one file file necessary to resolve a missing file error, the next error will pop out."? It may be clearer to say "Otherwise, once you resolve one missing dependency, the next one will appear." – Teepeemm Mar 27 '19 at 14:42
  • Bubaya, I agree. I tried out the same but then once I started getting dependency issues. I felt it was better to install the entire version than installing each dependency file one by one for Tex. – ashwinjoseph Apr 02 '19 at 06:26
  • 1
    sudo apt-get install texlive-latex-extra would be a more conservative alternative. – ms609 Sep 15 '21 at 09:47
  • After seeing millions of files and gigabytes on my Mac, I'm hesitant to ever download a full latex distribution. – Sridhar Sarnobat Apr 11 '22 at 00:50