How (and why) to use TeX Live

Aug 11, 2022 by Thibault Debatty | 1401 views

Teaching

https://cylab.be/blog/233/how-and-why-to-use-tex-live

LaTeX may be almost 40 years old now (first release dates from 1984), it is still a very active ecosystem. On CTAN, more than 100 packages are created or updated every month. To get the best results for your book or paper, you should keep your LaTeX packages updated. This is precisely the goal of TeX Live…

CTAN monthly uploads

Monthly uploads on CTAN. Source: ctan.org

How it works

TeX Live is a complete TeX/LaTeX environment maintained by the TeX Users Group (TUG). It includes all the major TeX-related programs (like tex and pdflatex), packages, and fonts.

TeX Live also provides tools to keep your environment updated. For example, the tlmgr utility allows to download or update LaTeX macro packages.

TUG releases one major version of TeX each year. So in this post we will be installing TeX 2022.

Why not install texlive from your distribution?

Indeed, most Linux distributions also provide a ‘texlive’ package that you can install with apt install texlive or yum install texlive for example. However, these are ‘static’ versions of TeX Live, that are only updated by the distribution maintainer.

For example, you cannot use tlmgr to download or update your macro packages. This means your are usually stuck with an outdated environemnt.

Installation

Hence the best way to use TeX Live is using the installation script. Pay attention that this will install TeX/LaTeX and all CTAN packages. So it will take roughly 8 GB of disk space.

cd /tmp
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
zcat install-tl-unx.tar.gz | tar xf -
cd install-tl-*
perl ./install-tl --no-interaction

TeX binaries will be installed to /usr/local/texlive/2022/bin/x86_64-linux, so you should add this directory to your PATH:

echo 'export PATH="/usr/local/texlive/2022/bin/x86_64-linux:$PATH"' | 
  sudo tee --append /etc/bash.bashrc

After login out and back in, you can test your installation with

tex --version

tex-versuib.png

Update TeX packages

tlmgr is a utility tool that can be used to download new TeX macro packages or update existing ones.

Set-up

But first, tlmgr requires some additional configuration steps:

  1. initiliaze the local database:
tlmgr init-usertree

Otherwize you will get a cryptic error like cannot setup TLPDB in /home/USER/texmf at /usr/bin/tlmgr line 5308.

  1. install xzdec, that will be used by tlmgr to decompress downloaded content:
sudo apt install xzdec

Update packages

You can now update your LaTeX environment with:

sudo env "PATH=$PATH" tlmgr update --all

tlmgr-update.png

This blog post is licensed under CC BY-SA 4.0

This website uses cookies. More information about the use of cookies is available in the cookies policy.
Accept