From patchwork Wed Mar 2 09:55:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37575 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6215F27BBEA; Wed, 2 Mar 2022 09:57:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B041027BBE9 for ; Wed, 2 Mar 2022 09:57:27 +0000 (GMT) Received: from localhost ([::1]:49558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPLja-0003F7-RZ for patchwork@mira.cbaines.net; Wed, 02 Mar 2022 04:57:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPLjD-0003E9-8o for guix-patches@gnu.org; Wed, 02 Mar 2022 04:57:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPLjC-000311-UH for guix-patches@gnu.org; Wed, 02 Mar 2022 04:57:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nPLjB-0007Jz-NT; Wed, 02 Mar 2022 04:57:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54220] [PATCH] doc: Add "Using TeX and LaTeX" chapter. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: rekado@elephly.net, mail@nicolasgoaziou.fr, bauermann@kolabnow.com, guix-patches@gnu.org Resent-Date: Wed, 02 Mar 2022 09:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54220 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54220@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Ricardo Wurmus , Nicolas Goaziou , Thiago Jung Bauermann X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ricardo Wurmus , Nicolas Goaziou , Thiago Jung Bauermann Received: via spool by submit@debbugs.gnu.org id=B.164621497728075 (code B ref -1); Wed, 02 Mar 2022 09:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Mar 2022 09:56:17 +0000 Received: from localhost ([127.0.0.1]:39128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPLiS-0007Ik-KG for submit@debbugs.gnu.org; Wed, 02 Mar 2022 04:56:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:39964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPLiQ-0007Ic-FN for submit@debbugs.gnu.org; Wed, 02 Mar 2022 04:56:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPLiQ-000389-6d for guix-patches@gnu.org; Wed, 02 Mar 2022 04:56:14 -0500 Received: from [2001:470:142:3::e] (port=54766 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPLiP-0002vq-OS; Wed, 02 Mar 2022 04:56:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=fUBnh3uBE3R4vs0rtLej1xzUKYGQl+YFrU8kJepPTBg=; b=CGdhgR9V6h24/8 WU+Nt+JWYHwnEN4qvJ3BVd6o8KOuyqW5SzBWG5ejnhiuHAPWIdeIAbFZ4bOmT4o/FiOdbFbDldsEV 72uAa1c6ByON2SdQS8n6Fv4MIk81+B5/CjHCx6hImFa/RDuHzZHxzUnRP1o9wVvq7vydEdYOm0fqu 0qLNzf8GlJOYX2POd+esbJyfUlUA/sAaRKv7ECHRmwDVhLJ2BxOvUX68Qk3cxlMYXbyWC4m0MsS7n zQXSK4XR1MYsqV9ulfb2u8vyXfxfNCfw+TdjhXbxwb19kLPCxyuVWmQhHrXM+0ZSosS2Gg0d8i0fx dmj3jO3A5tzswRIVxuvw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:50044 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPLiP-0006yN-73; Wed, 02 Mar 2022 04:56:13 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Wed, 2 Mar 2022 10:55:50 +0100 Message-Id: <20220302095550.17700-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Using TeX and LaTeX): New node. --- doc/guix.texi | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) Hello! This patch documents the current state of TeX/LaTeX packaging and tips and tricks to get things done with the modular package set. I’m writing this as an eternal TeX/LaTeX newbie (and as a Lout refugee!) not completely familiar with the intricacies of TeX Live packaging, so this section might need corrections and improvements. It’s a top-level chapter, because I couldn’t find any better place, but I think it’s fine. Thoughts? Ludo’. base-commit: a53ea46bfc219a2c184fbf3ce8f3e3ba3f539a7d diff --git a/doc/guix.texi b/doc/guix.texi index 1e8b23ad7e..1c11cc8d5a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -175,6 +175,7 @@ Weblate} (@pxref{Translating Guix}). * Home Configuration:: Configuring the home environment. * Documentation:: Browsing software user manuals. * Installing Debugging Files:: Feeding the debugger. +* Using TeX and LaTeX:: Typesetting. * Security Updates:: Deploying security fixes quickly. * Bootstrapping:: GNU/Linux built from scratch. * Porting:: Targeting another platform or kernel. @@ -38622,6 +38623,146 @@ Note that there can be packages for which @option{--with-debug-info} will not have the desired effect. @xref{Package Transformation Options, @option{--with-debug-info}}, for more information. +@node Using TeX and LaTeX +@chapter Using @TeX{} and @LaTeX{} + +@cindex @TeX{} packages +@cindex @LaTeX{} packages +Guix provides packages for the @TeX{} and @LaTeX{} typesetting systems, +taken from the @uref{https://www.tug.org/texlive/, @TeX{} Live +distribution}. However, because @TeX{} Live is so huge and because +finding your way in this maze is tricky, we thought that you, dear user, +would welcome guidance on how to deploy the relevant packages so you can +compile your @TeX{} and @LaTeX{} documents. + +@TeX{} Live currently comes in two flavors in Guix: + +@itemize +@item +The ``monolithic'' @code{texlive} package: it comes with @emph{every +single @TeX{} Live package} (more than 7,000 of them), but it is huge +(more than 4@tie{}GiB for a single package!). + +@item +The ``modular'' @code{texlive-} packages: you install +@code{texlive-base}, which provides core functionality and the main +commands---@command{pdflatex}, @command{dvips}, @command{luatex}, +@command{mf}, etc.---together with individual packages that provide just +the features you need---@code{texlive-latex-listings} for the +@code{listings} package, @code{texlive-hyperref} for @code{hyperref}, +@code{texlive-beamer} for Beamer, @code{texlive-latex-pgf} for PGF/TikZ, +and so on. +@end itemize + +We recommend using the modular package set because it is much less +resource-hungry. To build your documents, you would use commands such +as: + +@example +guix shell texlive-base texlive-latex-wrapfig \ + texlive-hyperref texlive-cm-super -- pdflatex doc.tex +@end example + +You can quickly end up with unreasonably long command lines though. The +solution is to instead write a manifest, for example like this one: + +@lisp +(specifications->manifest + '("rubber" + + "texlive-base" + "texlive-latex-wrapfig" + + "texlive-microtype" + "texlive-latex-listings" "texlive-hyperref" + + ;; PGF/TikZ + "texlive-latex-pgf" + + ;; Additional fonts. + "texlive-cm-super" "texlive-amsfonts" + "texlive-times" "texlive-helvetic" "texlive-courier")) +@end lisp + +You can then pass it to any command with the @option{-m} option: + +@example +guix shell -m manifest.scm -- pdflatex doc.tex +@end example + +@xref{Invoking guix package, @option{--manifest}}, for more on +manifests. In the future, we plan to provide packages for @TeX{} Live +@dfn{collections}---``meta-packages'' such as @code{fontsrecommended}, +@code{humanities}, or @code{langarabic} that provide the set of packages +needed in this particular domain. That will allow you to list fewer +packages. + +The main difficulty here is that using the modular package set forces +you to select precisely the packages that you need. You can use +@command{guix search}, but finding the right package can prove to be +tedious. When a package is missing, @command{pdflatex} and similar +commands fail with an obscure message along the lines of: + +@example +doc.tex: File `tikz.sty' not found. +doc.tex:7: Emergency stop. +@end example + +@noindent +or, for a missing font: + +@example +kpathsea: Running mktexmf phvr7t +! I can't find file `phvr7t'. +@end example + +How do you determine what the missing package is? In the first case, +you'll find the answer by running: + +@example +$ guix search texlive tikz +name: texlive-latex-pgf +version: 59745 +@dots{} +@end example + +In the second case, @command{guix search} turns up nothing. Instead, +you can search the @TeX{} Live package database using the @command{tlmgr} +command: + +@example +$ guix shell texlive-base -- 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 +@end example + +The file is available in the @TeX{} Live @code{helvetic} package, which is +known in Guix as @code{texlive-helvetic}. Quite a ride, but we found +it! + +There is one important limitation though: Guix currently provides a +subset of the @TeX{} Live packages. If you stumble upon a missing +package, you can try and import it (@pxref{Invoking guix import}): + +@example +guix import texlive @var{package} +@end example + +@quotation Note +@TeX{} Live packaging is still very much work in progress, but you can +help! @xref{Contributing}, for more information. +@end quotation + @node Security Updates @chapter Security Updates