Install LaTeX from Scratch: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:
mkdir ~/soft
mkdir ~/soft
cd ~/soft
cd ~/soft
rm -rf install-tl*
wget http://mirrors.dotsrc.org/ctan/systems/texlive/tlnet/install-tl-unx.tar.gz
wget http://mirrors.dotsrc.org/ctan/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -zxvf install-tl-unx.tar.gz
tar -zxvf install-tl-unx.tar.gz

Revision as of 22:39, 5 January 2010

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 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

Which version is used by default depends on how the environment variable PATH is defined.