Guix provides packages for the TeX, LaTeX, ConTeXt, LuaTeX, and related typesetting systems, taken from the TeX Live distribution. However, because TeX Live is so huge and because finding one’s way in this maze is tricky, so this section provides some guidance on how to deploy the relevant packages to compile TeX and LaTeX documents.
TeX Live currently comes in two mutually exclusive flavors in Guix:
texlivepackage: it comes with every single TeX Live package (roughly 4,200), but it is huge—more than 4 GiB for a single package!
So to insist, these two flavors cannot be combined41. If in the modular setting your document
does not compile, the solution is not to add the monolithic
package, but to add the set of missing packages from the modular
Building a coherent system that provides all the essential tools and, at the same time, satisfies all of its internal dependencies can be a difficult task. It is therefore recommended to start with sets of packages, called collections, and schemes, the name for collections of collections. The following command lists available schemes and collections (voir Invoking guix package):
guix search texlive-\(scheme\|collection\) | recsel -p name,description
If needed, you may then complete your system with individual packages, particularly when they belong to a large collection you’re not otherwise interested in.
For instance, the following manifest is a reasonable, yet frugal starting point for a French LaTeX user:
(specifications->manifest '("rubber" "texlive-scheme-basic" "texlive-collection-latexrecommended" "texlive-collection-fontsrecommended" "texlive-babel-french" ;; From "latexextra" collection. "texlive-tabularray" ;; From "binextra" collection. "texlive-texdoc"))
If you come across a document that does not compile in such a basic setting,
the main difficulty is finding the missing packages. In this case,
pdflatex and similar commands tend to fail with obscure error
messages along the lines of:
doc.tex: File `tikz.sty' not found. doc.tex:7: Emergency stop.
ou, pour une police manquante :
kpathsea: Running mktexmf phvr7t ! I can't find file `phvr7t'.
How do you determine what the missing package is? In the first case, you will find the answer by running:
$ guix search texlive tikz name: texlive-pgf version: 59745 …
Dans le second cas,
guix search ne renvoie rien. À la place, vous
pouvez chercher dans la base de données des paquets TeX Live avec la
$ tlmgr info phvr7t tlmgr: cannot find package phvr7t, searching for other matches: Packages containing `phvr7t' in their title/description: Packages containing files matching `phvr7t': helvetic: texmf-dist/fonts/tfm/adobe/helvetic/phvr7t.tfm texmf-dist/fonts/tfm/adobe/helvetic/phvr7tn.tfm texmf-dist/fonts/vf/adobe/helvetic/phvr7t.vf texmf-dist/fonts/vf/adobe/helvetic/phvr7tn.vf tex4ht: texmf-dist/tex4ht/ht-fonts/alias/adobe/helvetic/phvr7t.htf
The file is available in the TeX Live
helvetic package, which is
known in Guix as
texlive-helvetic. Quite a ride, but you found it!
No rule without
exception! As the monolithic TeX Live does not contain the
biber executable, it is okay to combine it with
texlive-biber, which does.