петък, 17 август 2012 г.

How to install manually latex packages

Ok, TeX and LaTeX have wonderful wikis but still, I'd like to write down the steps I took today, so that I don't forget them.
So, to install those packages you need to:
1. Install TeX from wherever you like.
2. Download the packages from http://ctan.org/search/
3. Following this wiki, you need to unpack the zips to a folder.
4. Then you run latex filename.ins to unpack the styles (and you run it on every file in the folder)
5. If you want the div files with instructions, you can run latex filename.dtx, but I didn't bother with that.
6. Key part: where to put them. Thanks to this site, I found that you can check for the paths of your latex installation using:
kpsepath tex 
kpsepath bst
you can find the paths recognised by your tex installation, Then you need to put the folder with your packages into one of those paths. What I did was:
sudo cp -r ~/Latex/packages/ /usr/share/texmf/tex/latex/
sudo texhash
And that was it. I got all the packages working in no times. Yeah!

A nice way to check whether the installation is good is to run:
fmtutil-sys --all
After an update I had some problems, but it turned out that I had to remove two random files from my packages folder. 
 
Update, on my current installation, the tex files are in " /usr/share/texmf-dist/" so I had to do:
$sudo cp -r ~/Downloads/revtex.tds/* /usr/share/texmf-dist/
$ sudo mktexlsr
Note that Latex keeps the paths in  
$TEXMFCNF=/usr/share/texlive/texmf-dist/web2c:/usr/share/texmf/web2c:$HOME/texmf/web2c  
export TEXMFCNF
or $TEXMFHOME or elsewhere for Gentoo. 

Няма коментари:

Публикуване на коментар