TeX Live

From Gentoo Wiki
Jump to: navigation, search

TeX Live is a complete TeX distribution with several programs to create professional documents.


USE flags

USE flags for app-text/texlive A complete TeX distribution

X Add support for X11 global
cjk Add support for Multi-byte character languages (Chinese, Japanese, Korean) global
context Add support for the ConTeXt format (dev-texlive/texlive-context) local
detex Add support for dev-tex/detex, a filter program that removes the LaTeX (or TeX) control sequences local
dvi2tty Add support for dev-tex/dvi2tty to preview dvi-files on text-only devices local
epspdf Add support for app-text/epspdf, a tool for converting [e]ps files to pdf. local
extra Add support for extra TeXLive packages local
games Add typesetting support for games (chess, etc.) (dev-texlive/texlive-games) local
graphics Add support for several graphics packages (pgf, tikz,...) local
humanities Add LaTeX support for the humanities (dev-texlive/texlive-humanities) local
jadetex Add support for app-text/jadetex (for processing tex files produced by the TeX backend of Jade) local
luatex Add extra support for luatex local
metapost Add support for metapost: A tool for creating graphics in scalable PostScript. local
music Add support for music typesetting (dev-texlive/texlive-music) local
pdfannotextractor Add dev-tex/pdfannotextractor support, for extracting annotations from PDF files. local
png Add support for libpng (PNG images) global
pstricks Add pstricks packages (dev-texlive/texlive-pstricks) local
publishers Add support for publishers (dev-texlive/texlive-publishers) local
science Add typesetting support for natural and computer sciences (dev-texlive/texlive-science) local
tex4ht Add support for dev-tex/tex4ht (for converting (La)TeX to (X)HTML, XML and OO.org) local
texi2html Add support for app-text/texi2html which converts texi files to HTML. local
truetype Add support for FreeType and/or FreeType2 fonts global
xetex Add support for XeTeX macros (dev-texlive/texlive-xetex) local
xindy Add support for app-text/xindy, a flexible indexing system local
xml Add support for XML files global


Install app-text/texlive:

root #emerge --ask app-text/texlive
When wanting to merge multiple Doxygen PDF files into one PDF file, or book style PDF preferable for E-Reading devices; it is likely the dev-texlive/texlive-latexextra package will be needed to be installed. (i.e. pdflatex refman.tex)


When users try to upgrade TeXLive, they'll meet a failure due to "hard blocking". Here are a solution to overcome it and the reasons behind it.


First you need to unmerge some packages in dev-texlive:

root #qlist -I dev-texlive/texlive-lang > texlive-lang-packages.txt
root ## Or if you prefer 'eix' to qlist, do instead:
root #eix '-I#' dev-texlive/texlive-lang > texlive-lang-packages.txt
root ## Then
root #emerge --deselect=n --unmerge texlive-latex texlive-basic $(cat texlive-lang-packages.txt)

Now you can upgrade:

root # emerge --ask --oneshot --update app-text/texlive $(cat texlive-lang-packages.txt)

Or simply pull in "world":

root # emerge -uDN1a @world

Why this workaround?

Some dev-texlive/texlive-* packages (see below) do "hard blocking". For example, texlive-basic-2016 hard-blocks <texlive-basic-2016, i.e., older versions of itself. Hard-blocked packages can't be installed simultaneously, even temporarily. But as of 2017, portage can't resolve hard blocks automatically (bug #250286), and users must handle them manually. They are hard instead of normal blocks because of some file moves. (bug #606730)

Thus, to upgrade texlive-basic, users must first unmerge it manually using the above procedure.

Some more details

Although some language packs have only 2012 versions (e.g. texlive-langcroatian-2012), even for them the above solution (re-emerging them afterwards) works, too. It's because blocking in an ebuild file is in fact one-sided, unlike normal dependency, which is checked at "emerge --depclean": Assume virtual/src-0.ebuild contains DEPEND="!!cat/dest", and cat/dest-0.ebuild has no dependency. Then:

  • if you already have cat/dest, then "emerge virtual/src" will fail. However,
  • even if you already have virtual/src, "emerge cat/dest" is allowed.

Hard blocking is specified in ebuilds by the operator !!. As of 2017, the only ebuilds using the !! operator (in our context) are texlive-basic, texlive-latex, and texlive-langcjk. Packages blocked by them are these three themselves plus texlive-lang*.


Most of the time users will implement TeX Live through the editor of choice. The following is a list of compilers capable of translating a .tex document into .pdf file:


user $pdflatex mydocument.tex


user $xelatex mydocument.tex


user $luatex mydocument.tex


There are several editors users can choose from in Gentoo. To list a few pure TeX editors:

Editor Package Homepage Description
kile app-editors/kile http://kile.sourceforge.net/ A KDE based editor, which lets users write in LaTeX code and then compile the document.
texmaker app-office/texmaker http://www.xm1math.net/texmaker/ A Qt based editor, which lets user write in LaTeX code and then compile the document
texstudio app-office/texstudio http://texstudio.sourceforge.net/ Free cross-platform LaTeX editor (former texmakerX)
gummi app-editors/gummi https://github.com/alexandervdm/gummi GTK+ based editor, which lets users write in LaTeX code and then compile the document
latexila app-editors/latexila https://wiki.gnome.org/Apps/LaTeXila GNOME based editor, which lets users write in LaTeX code and then compile the document
lyx app-office/lyx https://www.lyx.org/ Qt based WYSIWYM editor, users type directly into the LaTeX document and can edit LaTeX code afterwards
texworks app-editors/texworks https://www.tug.org/texworks/ Qt based editor, suggested editor by the UK-TUG which lets users write in LaTeX code and then compile the document. Can be found in the betagarden ebuild repository as live ebuild.
The above table is not a comprehensive list of TeX editors.

Most editors support LaTeX syntax highlighting like Vim, emacs (which supports compilation and previewing), gedit or gleany and most development IDE's provide some plugins like dev-util/netbeans.

Programs with LaTeX support

Find the Gentoo package that contains a tex package

dev-tex/texmfind contains a program to search for the Gentoo package containing a TeX package. For example, texmfind bbm.sty returns dev-texlive/texlive-fontsextra.

eselect pdftex

Gentoo would automatically clean out any previous version during upgrade. In order to intentionally install several versions into different slots a script exists that enables easy switching:

root #emerge --ask app-eselect/eselect-pdftex

List available distributions with the following command:

root #eselect pdftex list

To set the distribution:

root #eselect pdftex set 1


Shows the original TeX documentation by keywords. For example everything about article:

user $texdoc article

This should open the default PDF viewer with the documentation.

In order to use the texdoc command, the doc USE flag enabled for TeX Live and any other module which users would like documentation available.

To enable the doc USE flag on any TeX Live module automatically, use a wildcard:

root #echo dev-texlive/* doc >> /etc/portage/package.use

A full list of installed TeX modules can be shown with the following command:

root #qlist -C -I texlive

To enable the doc USE flag only for certain modules, add them to /etc/portage/package.use. A quick way of adding them all is by running this command:

root #qlist -C -I texlive | sed 's/$/ doc/' >> /etc/portage/package.use
Afterwards edit the USE flags for each module in /etc/portage/package.use individually

External resources