sâmbătă, 7 decembrie 2013

Long Live The TeX Live (or How to install TeX Live on Ubuntu?)


What is the most common encountered error message when you try to compile a latex document which wasn't made by you?... Exactly:

! LaTeX Error: File `<somefilename>.sty' not found.

What is the solution? There are at least three solutions:
  1. You could download the package files from the Comprehensive TeX Archive Network and install manually in your system.
  2. If you use a GNU/Linux distribution, Ubuntu for example, then you could google the name of the Ubuntu package (or Debian package) which in turn, contains the latex package that you need and install the first via the apt-get command.
  3. If you use MS Windows then you could launch the Package Manager program from MiKTeX software and install the package via one-two clicks of mouse.
After N years of solving this problem I can say with certitude that I'm tired of solution 1 and 2. I like the solution 3, but it's only available on Windows... Is there a way to move the solution 3 to GNU/Linux context? Yes! It is called TeX Live (2013). And the steps for implementing the solutions are presented bellow.

1. Get rid of all texlive Ubuntu packages

sudo apt-get remove texlive-base

2. Download the TeX Live (2013) installation files form http://tug.org/texlive/acquire.html and install it.

wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xf install-tl-unx.tar.gz
cd install-tl-20131125
sudo ./install-tl

type I for the question and wait about two - three hours for installation process to finish.

3. Install the dependencies for the graphic interface of the TeX Live (2013) programs. 

sudo apt-get install tk
sudo apt-get install perl-tk

4. Clone key files from TeX Live located in /usr/local/ to /usr/ 

Run: sudo /usr/local/texlive/2013/bin/x86_64-linux/tlmgr --gui

From the Actions menu (Fig. 1) select Handle symlinks in system dirs... item and in the dialog that will show (Fig. 2) click on Update symbolic links button, then on OK.



Figure 1. TeX Live Manager 2013 GUI




 Figure 2. Handle symlinks in system dirs dialog

This step is necessary because it seems that some executable from tlmgr do not use internaly relative paths, but absloute paths like /usr/bin/tex

5. Install the necessary package

sudo tlmgr install <somepackagename>

Voilà.

Niciun comentariu:

Trimiteți un comentariu