Install LaTeX from Scratch
This method installs the TeXLive LaTeX implementation from the internet. First download the installer from any CTAN (Comprehensive TeX Archive Network) repository and decompress it. For example,
mkdir ~/soft cd ~/soft rm -rf install-tl* wget http://mirrors.dotsrc.org/ctan/systems/texlive/tlnet/install-tl-unx.tar.gz tar -zxvf install-tl-unx.tar.gz cd install-tl-*
The installation will be performed in the user directory
mkdir -p ~/usr
More specifically, the main installation will be located at /usr/local/texlive.
The run the installer
./install-tl
Interactively, it is important to set the installation directory to ~/usr/local/texlive (instead of /usr/local/texlive) and to set 'letter' as the default paper size (unless you use A4 like in the rest of the civilized world). After confirming the options the installation will proceed to download and install around 2000 standard packages (including for example beamer, tikz, revtex, etc, etc, etc, etc). Optionally we can indicate that links to the tex tools should be created in ~/usr/local/bin.
The download/install took 3 hours in my computer and uses ~2GB (smaller installation is possible during the interactive setup).
After that, we have to add the tex tools (for example pdflatex, latex, bibtex) to the PATH. If the links were created in ~/usr/local/bin then that is the directory that should be in the PATH (if not yet). The PATH can be set in the .bashrc file for example.
Two TeX system coexisting
Two different TeX systems/installations can coexists. For example, if the system had already a TeX system installed we can force to run that particular version by using the command
/usr/bin/pdflatex example.tex
or we can make sure our own install is used by doing
~/usr/local/bin/pdflatex example.tex
In my system I have two versions, the system-wide one (very old)
$ /usr/bin/pdflatex -v pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4)
and the personal one:
$ ~/usr/local/bin/pdflatex -v pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009)
Which version is used by default depends on how the environment variable PATH is defined.