How do I install a package which is supplied by a publisher (like Springer or Elsevier)? In MikTex (windows), I have to copy it into specified folder and than run some file which install the package. What are the corresponding actions in ubuntu with TeXLive?
4 Answers
Put them into
~/texmf/tex/latex/springer
where ~ stands for your home. This for the .cls or .sty files; if there is a .bst file it should go into
~/texmf/bibtex/bst/springer
(choose a different name than springer, if you want to).
If you need to make the package available to all users on your system, the "local" tree is the correct place. On a terminal window type
kpsewhich --var-value TEXMFLOCAL
and the answer is what you should substitute to ~/texmf in the paths above. Copy the files and do
sudo texmklsr
- 1,121,712
May I point you to the excellent TeX FAQ, which answers this and other questions?
- 757,742
- 15,156
Another alternative is to put the files in /usr/local/share/texmf instead of ~/texmf or /usr/share/texmf. Personally, think this is preferable because I don't like seeing the texmf directory all the time in my home directory. It also doesn't clutter the main tree. In case you're on a multiuser system then others can also use the packages. Naturally this demands sudo rights for your user.
- 73
-
Btw, this does not actually require sudo rights. It only requires write permission to the directory. You can give your user this permission once and for all so you don't need to use sudo every time you want to install a new package locally. – mpg Jun 28 '11 at 20:10
You just copy the package (unziped) into the folder: /usr/share/texmf/tex/latex
After that you open the terminal in this folder and type: texhash
You'll need root privileges to do that. It's important read the documentation of the specific packages to find any important detail.
- 133
-
2Using the main TeX tree is not recommended. An update to the distribution may destroy all changes. – egreg Jun 23 '11 at 13:40
-
-
1Well, you may have them when Ubuntu will shift to TeX Live 2010 (in 2013 or so). – egreg Jun 23 '11 at 13:50
-
@Jasper: let's wait and see.
:-)The problem is not in the version, of course, but in the fact that the installation process might destroy personal changes. This won't happen to the local tree. – egreg Jun 23 '11 at 14:02
texhash ~/texmfif you already have a~/texmf/ls-Rcache file. Newer TeX version do not need this file for the usertexmftree but will search it for requested files. However, if thels-Rfile is present it will be used and no search is done. So you need to either update or delete this file after installing new files in this tree, otherwise they won't be found. – Martin Scharrer Jun 23 '11 at 13:50ls-Rfile if the tree is not mentionned inTEXMFDBS, precisely to avoid this issue. Anyway, it is best not to have als-Rfile in~/texmf, which is the default since TeX Live 2007. – mpg Jun 28 '11 at 20:14texmfdirectory structure. – Serrano Jan 06 '15 at 14:40