gnu: Add emacs-helm-flycheck.
[guix.git] / gnu / packages / tex.scm
blobb6bc9dda626679cce135ad04dfba11e9697de241
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
6 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
8 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
9 ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
12 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2018 Danny Milosavljevic <dannym+a@scratchpost.org>
14 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
15 ;;;
16 ;;; This file is part of GNU Guix.
17 ;;;
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
22 ;;;
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26 ;;; GNU General Public License for more details.
27 ;;;
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages tex)
32   #:use-module ((guix licenses) #:prefix license:)
33   #:use-module (guix packages)
34   #:use-module (guix download)
35   #:use-module (guix build-system cmake)
36   #:use-module (guix build-system gnu)
37   #:use-module (guix build-system perl)
38   #:use-module (guix build-system trivial)
39   #:use-module (guix build-system texlive)
40   #:use-module (guix utils)
41   #:use-module (guix git-download)
42   #:use-module (guix svn-download)
43   #:use-module (gnu packages)
44   #:use-module (gnu packages algebra)
45   #:use-module (gnu packages autotools)
46   #:use-module (gnu packages bash)
47   #:use-module (gnu packages boost)
48   #:use-module (gnu packages compression)
49   #:use-module (gnu packages fontutils)
50   #:use-module (gnu packages gd)
51   #:use-module (gnu packages ghostscript)
52   #:use-module (gnu packages gtk)
53   #:use-module (gnu packages icu4c)
54   #:use-module (gnu packages image)
55   #:use-module (gnu packages libreoffice)
56   #:use-module (gnu packages lua)
57   #:use-module (gnu packages multiprecision)
58   #:use-module (gnu packages pdf)
59   #:use-module (gnu packages perl)
60   #:use-module (gnu packages perl-check)
61   #:use-module (gnu packages pkg-config)
62   #:use-module (gnu packages python)
63   #:use-module (gnu packages qt)
64   #:use-module (gnu packages ruby)
65   #:use-module (gnu packages shells)
66   #:use-module (gnu packages base)
67   #:use-module (gnu packages web)
68   #:use-module (gnu packages xml)
69   #:use-module (gnu packages xorg)
70   #:use-module (gnu packages xdisorg)
71   #:autoload   (gnu packages texinfo) (texinfo)
72   #:use-module (ice-9 ftw)
73   #:use-module (ice-9 match)
74   #:use-module ((srfi srfi-1) #:hide (zip)))
76 (define texlive-extra-src
77   (origin
78     (method url-fetch)
79     (uri "ftp://tug.org/historic/systems/texlive/2017/texlive-20170524-extra.tar.xz")
80     (sha256 (base32
81               "0zvd2zskk78ig114mfj24g15qys41hzqv59fmqpirdbgq9c9gr5g"))))
83 (define texlive-texmf-src
84   (origin
85     (method url-fetch)
86     (uri "ftp://tug.org/historic/systems/texlive/2017/texlive-20170524-texmf.tar.xz")
87     (sha256 (base32
88               "1v69y3kgkbk24f7s4dfkknwd317mqmck5jgpyb35wqgqfy5p0qrz"))))
90 (define-public texlive-bin
91   (package
92    (name "texlive-bin")
93    (version "20170524")
94    (source
95     (origin
96      (method url-fetch)
97       (uri (string-append "ftp://tug.org/historic/systems/texlive/2017/"
98                           "texlive-" version "-source.tar.xz"))
99       (patches
100        (list
101         ;; This is required for compatibility with Poppler >= 0.58.
102         ;; See <http://tutex.tug.org/pipermail/tex-k/2017-September/002809.html>
103         ;; and <https://bugs.archlinux.org/task/55720> for some discussion.
104         (origin
105           (method url-fetch)
106           (uri (string-append "https://git.archlinux.org/svntogit/packages.git/plain"
107                               "/trunk/texlive-poppler-0.59.patch?h=packages/texlive-bin"
108                               "&id=ba2de374e2b21ecc4b85cc9777f2f15c4d356c61"))
109           (file-name "texlive-poppler-compat.patch")
110           (sha256
111            (base32
112             "1c4ikq4kxw48bi3i33bzpabrjvbk01fwjr2lz20gkc9kv8l0bg3n")))))
113       (sha256 (base32
114                "1amjrxyasplv4alfwcxwnw4nrx7dz2ydmddkq16k6hg90i9njq81"))))
115    (build-system gnu-build-system)
116    (inputs
117     `(("texlive-extra-src" ,texlive-extra-src)
118       ("cairo" ,cairo)
119       ("fontconfig" ,fontconfig)
120       ("fontforge" ,fontforge)
121       ("freetype" ,freetype)
122       ("gd" ,gd)
123       ("gmp" ,gmp)
124       ("ghostscript" ,ghostscript)
125       ("graphite2" ,graphite2)
126       ("harfbuzz" ,harfbuzz)
127       ("icu4c" ,icu4c)
128       ("libpaper" ,libpaper)
129       ("libpng" ,libpng)
130       ("libxaw" ,libxaw)
131       ("libxt" ,libxt)
132       ("mpfr" ,mpfr)
133       ("perl" ,perl)
134       ("pixman" ,pixman)
135       ("poppler" ,poppler)
136       ("potrace" ,potrace)
137       ("python" ,python-2) ; incompatible with Python 3 (print syntax)
138       ("ruby" ,ruby)
139       ("tcsh" ,tcsh)
140       ("teckit" ,teckit)
141       ("zlib" ,zlib)
142       ("zziplib" ,zziplib)))
143    (native-inputs
144     `(("pkg-config" ,pkg-config)))
145    (arguments
146     `(#:out-of-source? #t
147       #:configure-flags
148        `("--disable-native-texlive-build"
149          ;; XXX: This is needed because recent Poppler requires C++11 or later.
150          ;; Remove after switch to GCC >= 6.
151          "CXXFLAGS=-std=gnu++11"
152          "--with-system-cairo"
153          "--with-system-freetype2"
154          "--with-system-gd"
155          "--with-system-gmp"
156          "--with-system-graphite2"
157          "--with-system-harfbuzz"
158          "--with-system-icu"
159          "--with-system-libgs"
160          "--with-system-libpaper"
161          "--with-system-libpng"
162          "--with-system-mpfr"
163          "--with-system-pixman"
164          "--with-system-poppler"
165          "--with-system-potrace"
166          "--with-system-teckit"
167          "--with-system-xpdf"
168          "--with-system-zlib"
169          "--with-system-zziplib")
171       ;; Disable tests on mips64/aarch64 to cope with a failure of luajiterr.test.
172       ;; XXX FIXME fix luajit properly on mips64 and aarch64.
173       #:tests? ,(let ((s (or (%current-target-system)
174                              (%current-system))))
175                   (not (or (string-prefix? "aarch64" s)
176                            (string-prefix? "mips64" s))))
177       #:phases
178        (modify-phases %standard-phases
179          (add-after 'unpack 'fix-unix-detection
180            ;; ps2eps.pl uses the "gswin32c" ghostscript executable on Windows,
181            ;; and the "gs" ghostscript executable on Unix. It detects Unix by
182            ;; checking for the existence of the /usr/bin directory. Since
183            ;; GuixSD does not have /usr/bin, it is also detected as Windows.
184            (lambda _
185              (substitute* "utils/ps2eps/ps2eps-src/bin/ps2eps.pl"
186                (("gswin32c") "gs"))
187              #t))
188          (add-after 'install 'postint
189            (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
190              (let* ((out (assoc-ref outputs "out"))
191                     (share (string-append out "/share"))
192                     (texlive-extra (assoc-ref inputs "texlive-extra-src"))
193                     (unpack (assoc-ref %standard-phases 'unpack))
194                     (patch-source-shebangs
195                       (assoc-ref %standard-phases 'patch-source-shebangs)))
196                ;; Create symbolic links for the latex variants and their
197                ;; man pages.
198                (with-directory-excursion (string-append out "/bin/")
199                  (for-each symlink
200                  '("pdftex" "pdftex"   "xetex"   "luatex")
201                  '("latex"  "pdflatex" "xelatex" "lualatex")))
202                (with-directory-excursion (string-append share "/man/man1/")
203                  (symlink "luatex.1" "lualatex.1"))
204                ;; Unpack texlive-extra and install tlpkg.
205                (mkdir "texlive-extra")
206                (with-directory-excursion "texlive-extra"
207                  (apply unpack (list #:source texlive-extra))
208                  (apply patch-source-shebangs (list #:source texlive-extra))
209                  (invoke "mv" "tlpkg" share))
210                ;; texlua shebangs are not patched by the patch-source-shebangs
211                ;; phase because the texlua executable does not exist at that
212                ;; time.
213                (setenv "PATH" (string-append (getenv "PATH") ":" out "/bin"))
214                (with-directory-excursion out
215                  (patch-source-shebangs))))))))
216    (synopsis "TeX Live, a package of the TeX typesetting system")
217    (description
218     "TeX Live provides a comprehensive TeX document production system.
219 It includes all the major TeX-related programs, macro packages, and fonts
220 that are free software, including support for many languages around the
221 world.
223 This package contains the binaries.")
224    (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
225    (home-page "https://www.tug.org/texlive/")))
227 (define-public texlive-dvips
228   (package
229     (name "texlive-dvips")
230     (version (number->string %texlive-revision))
231     (source (origin
232               (method svn-fetch)
233               (uri (svn-reference
234                     (url (string-append "svn://www.tug.org/texlive/tags/"
235                                         %texlive-tag "/Master/texmf-dist/"
236                                         "/dvips"))
237                     (revision %texlive-revision)))
238               (file-name (string-append name "-" version "-checkout"))
239               (sha256
240                (base32
241                 "0fcy2hpapbj01ncpjj3v39yhr0jjxb6rm13qaxjjw66s3vydxls1"))))
242     (build-system trivial-build-system)
243     (arguments
244      `(#:modules ((guix build utils))
245        #:builder
246        (begin
247          (use-modules (guix build utils))
248          (let* ((root (string-append (assoc-ref %outputs "out")
249                                      "/share/texmf-dist"))
250                 (dvips (string-append root "/dvips"))
251                 (maps  (string-append root "/fonts/map/dvips/tetex"))
252                 (encs  (string-append root "/fonts/enc/dvips/base")))
253            (mkdir-p dvips)
254            (copy-recursively (assoc-ref %build-inputs "source") dvips)
255            (mkdir-p maps)
256            (copy-recursively (assoc-ref %build-inputs "dvips-font-maps") maps)
257            (mkdir-p encs)
258            (copy-recursively (assoc-ref %build-inputs "dvips-base-enc") encs)
259            #t))))
260     (native-inputs
261      `(("dvips-font-maps"
262         ,(origin
263            (method svn-fetch)
264            (uri (svn-reference
265                  (url (string-append "svn://www.tug.org/texlive/tags/"
266                                      %texlive-tag "/Master/texmf-dist/"
267                                      "/fonts/map/dvips/tetex"))
268                  (revision %texlive-revision)))
269            (file-name (string-append "dvips-font-maps-" version "-checkout"))
270            (sha256
271             (base32
272              "100208pg7q6lj7swiq9p9287nn6b64bl62bnlaxpjni9y2kdrqy5"))))
273        ("dvips-base-enc"
274         ,(origin
275            (method svn-fetch)
276            (uri (svn-reference
277                  (url (string-append "svn://www.tug.org/texlive/tags/"
278                                      %texlive-tag "/Master/texmf-dist/"
279                                      "/fonts/enc/dvips/base"))
280                  (revision %texlive-revision)))
281            (file-name (string-append "dvips-base-enc-" version "-checkout"))
282            (sha256
283             (base32
284              "1xnf6ms0h87r55kxik4vicwr1907scj789lhqflqns8svvsli5iy"))))))
285     (home-page "https://www.ctan.org/pkg/dvips")
286     (synopsis "DVI to PostScript drivers")
287     (description "This package provides files needed for converting DVI files
288 to PostScript.")
289     ;; Various free software licenses apply to individual files.
290     (license (list license:lppl1.3c+
291                    license:expat
292                    license:lgpl3+))))
294 (define-public texlive-generic-unicode-data
295   (package
296     (name "texlive-generic-unicode-data")
297     (version (number->string %texlive-revision))
298     (source (origin
299               (method svn-fetch)
300               (uri (svn-reference
301                     (url (string-append "svn://www.tug.org/texlive/tags/"
302                                         %texlive-tag "/Master/texmf-dist/"
303                                         "/tex/generic/unicode-data"))
304                     (revision %texlive-revision)))
305               (file-name (string-append name "-" version "-checkout"))
306               (sha256
307                (base32
308                 "0ivrhp6jz31pl4z841g4ws41lmvdiwz4sslmhf02inlib79gz6r2"))))
309     (build-system trivial-build-system)
310     (arguments
311      `(#:modules ((guix build utils))
312        #:builder
313        (begin
314          (use-modules (guix build utils))
315          (let ((target (string-append (assoc-ref %outputs "out")
316                                       "/share/texmf-dist/tex/generic/unicode-data")))
317              (mkdir-p target)
318              (copy-recursively (assoc-ref %build-inputs "source") target)
319              #t))))
320     (home-page "https://www.ctan.org/pkg/unicode-data")
321     (synopsis "Unicode data and loaders for TeX")
322     (description "This bundle provides generic access to Unicode Consortium
323 data for TeX use.  It contains a set of text files provided by the Unicode
324 Consortium which are currently all from Unicode 8.0.0, with the exception of
325 @code{MathClass.txt} which is not currently part of the Unicode Character
326 Database.  Accompanying these source data are generic TeX loader files
327 allowing this data to be used as part of TeX runs, in particular in building
328 format files.  Currently there are two loader files: one for general character
329 set up and one for initializing XeTeX character classes as has been carried
330 out to date by @code{unicode-letters.tex}. ")
331     (license license:lppl1.3c+)))
333 (define-public texlive-generic-dehyph-exptl
334   (package
335     (name "texlive-generic-dehyph-exptl")
336     (version (number->string %texlive-revision))
337     (source (origin
338               (method svn-fetch)
339               (uri (svn-reference
340                     (url (string-append "svn://www.tug.org/texlive/tags/"
341                                         %texlive-tag "/Master/texmf-dist/"
342                                         "/tex/generic/dehyph-exptl"))
343                     (revision %texlive-revision)))
344               (file-name (string-append name "-" version "-checkout"))
345               (sha256
346                (base32
347                 "1l9wgv99qq0ysvlxqpj4g8bl0dywbzra4g8m2kmpg2fb0i0hczap"))))
348     (build-system trivial-build-system)
349     (arguments
350      `(#:modules ((guix build utils))
351        #:builder
352        (begin
353          (use-modules (guix build utils))
354          (let ((target (string-append (assoc-ref %outputs "out")
355                                       "/share/texmf-dist/tex/generic/dehyph-exptl")))
356            (mkdir-p target)
357            (copy-recursively (assoc-ref %build-inputs "source") target)
358            #t))))
359     (home-page "http://projekte.dante.de/Trennmuster/WebHome")
360     (synopsis "Hyphenation patterns for German")
361     (description "The package provides experimental hyphenation patterns for
362 the German language, covering both traditional and reformed orthography.  The
363 patterns can be used with packages Babel and hyphsubst from the Oberdiek
364 bundle.")
365     ;; Hyphenation patterns are under the Expat license; documentation is
366     ;; under LPPL.
367     (license (list license:expat license:lppl))))
369 (define-public texlive-generic-tex-ini-files
370   (package
371     (name "texlive-generic-tex-ini-files")
372     (version (number->string %texlive-revision))
373     (source (origin
374               (method svn-fetch)
375               (uri (svn-reference
376                     (url (string-append "svn://www.tug.org/texlive/tags/"
377                                         %texlive-tag "/Master/texmf-dist/"
378                                         "/tex/generic/tex-ini-files"))
379                     (revision %texlive-revision)))
380               (file-name (string-append name "-" version "-checkout"))
381               (sha256
382                (base32
383                 "1wh42n1lmzcvi3g6mm31nm3yd5ha5bl260xqc444jg1m9fdp3wz5"))))
384     (build-system trivial-build-system)
385     (arguments
386      `(#:modules ((guix build utils))
387        #:builder
388        (begin
389          (use-modules (guix build utils))
390          (let ((target (string-append (assoc-ref %outputs "out")
391                                       "/share/texmf-dist/tex/generic/tex-ini-files")))
392            (mkdir-p target)
393            (copy-recursively (assoc-ref %build-inputs "source") target)
394            #t))))
395     (home-page "https://www.ctan.org/pkg/tex-ini-files")
396     (synopsis "Files for creating TeX formats")
397     (description "This bundle provides a collection of model \".ini\" files
398 for creating TeX formats.  These files are commonly used to introduced
399 distribution-dependent variations in formats.  They are also used to
400 allow existing format source files to be used with newer engines, for example
401 to adapt the plain e-TeX source file to work with XeTeX and LuaTeX.")
402     (license license:public-domain)))
404 (define-public texlive-generic-hyph-utf8
405   (package
406     (name "texlive-generic-hyph-utf8")
407     (version (number->string %texlive-revision))
408     (source (origin
409               (method svn-fetch)
410               (uri (svn-reference
411                     (url (string-append "svn://www.tug.org/texlive/tags/"
412                                         %texlive-tag "/Master/texmf-dist/"
413                                         "/tex/generic/hyph-utf8"))
414                     (revision %texlive-revision)))
415               (file-name (string-append name "-" version "-checkout"))
416               (sha256
417                (base32
418                 "0ghizcz7ps16dzfqf66wwg5i181assc6qsm0g7g5dbmp909931vi"))))
419     (build-system trivial-build-system)
420     (arguments
421      `(#:modules ((guix build utils))
422        #:builder
423        (begin
424          (use-modules (guix build utils))
425          (let ((target (string-append (assoc-ref %outputs "out")
426                                       "/share/texmf-dist/tex/generic/hyph-utf8")))
427            (mkdir-p target)
428            (copy-recursively (assoc-ref %build-inputs "source") target)
429            #t))))
430     (home-page "https://ctan.org/pkg/hyph-utf8")
431     (synopsis "Hyphenation patterns expressed in UTF-8")
432     (description "Modern native UTF-8 engines such as XeTeX and LuaTeX need
433 hyphenation patterns in UTF-8 format, whereas older systems require
434 hyphenation patterns in the 8-bit encoding of the font in use (such encodings
435 are codified in the LaTeX scheme with names like OT1, T2A, TS1, OML, LY1,
436 etc).  The present package offers a collection of conversions of existing
437 patterns to UTF-8 format, together with converters for use with 8-bit fonts in
438 older systems.  Since hyphenation patterns for Knuthian-style TeX systems are
439 only read at iniTeX time, it is hoped that the UTF-8 patterns, with their
440 converters, will completely supplant the older patterns.")
441     ;; Individual files each have their own license.  Most of these files are
442     ;; independent hyphenation patterns.
443     (license (list license:lppl1.0+
444                    license:lppl1.2+
445                    license:lppl1.3
446                    license:lppl1.3+
447                    license:lppl1.3a+
448                    license:lgpl2.1
449                    license:lgpl2.1+
450                    license:lgpl3+
451                    license:gpl2+
452                    license:gpl3+
453                    license:mpl1.1
454                    license:asl2.0
455                    license:expat
456                    license:bsd-3
457                    license:cc0
458                    license:public-domain
459                    license:wtfpl2))))
461 (define-public texlive-metafont-base
462   (package
463     (name "texlive-metafont-base")
464     (version (number->string %texlive-revision))
465     (source (origin
466               (method svn-fetch)
467               (uri (svn-reference
468                     (url (string-append "svn://www.tug.org/texlive/tags/"
469                                         %texlive-tag "/Master/texmf-dist/"
470                                         "/metafont"))
471                     (revision %texlive-revision)))
472               (file-name (string-append name "-" version "-checkout"))
473               (sha256
474                (base32
475                 "1yl4n8cn5xqk2nc22zgzq6ymd7bhm6xx1mz3azip7i3ki4bhb5q5"))))
476     (build-system gnu-build-system)
477     (arguments
478      `(#:tests? #f ; no test target
479        #:phases
480        (modify-phases %standard-phases
481          (delete 'configure)
482          (replace 'build
483            (lambda* (#:key inputs #:allow-other-keys)
484              (let ((cwd (getcwd)))
485                (setenv "MFINPUTS"
486                        (string-append cwd "/base:"
487                                       cwd "/misc:"
488                                       cwd "/roex:"
489                                       cwd "/feynmf:"
490                                       cwd "/mfpic:"
491                                       cwd "/config")))
492              (mkdir "build")
493              (with-directory-excursion "build"
494                (invoke "inimf" "mf.mf"))))
495          (replace 'install
496            (lambda* (#:key outputs #:allow-other-keys)
497              (let* ((out  (assoc-ref outputs "out"))
498                     (base (string-append out "/share/texmf-dist/web2c"))
499                     (mf   (string-append out "/share/texmf-dist/metafont/base")))
500                (mkdir-p base)
501                (mkdir-p mf)
502                (install-file "build/mf.base" base)
503                (copy-recursively "base" mf)
504                #t))))))
505     (native-inputs
506      `(("texlive-bin" ,texlive-bin)))
507     (home-page "https://www.ctan.org/pkg/metafont")
508     (synopsis "Metafont base files")
509     (description "This package provides the Metafont base files needed to
510 build fonts using the Metafont system.")
511     (license license:knuth)))
513 (define-public texlive-fontname
514   (package
515     (name "texlive-fontname")
516     (version (number->string %texlive-revision))
517     (source (origin
518               (method svn-fetch)
519               (uri (svn-reference
520                     (url (string-append "svn://www.tug.org/texlive/tags/"
521                                         %texlive-tag "/Master/texmf-dist/"
522                                         "/fonts/map/fontname"))
523                     (revision %texlive-revision)))
524               (file-name (string-append name "-" version "-checkout"))
525               (sha256
526                (base32
527                 "0cssbzcx15221dynp5sii72qh4l18mwkr14n8w1xb19j8pbaqasz"))))
528     (build-system trivial-build-system)
529     (arguments
530      `(#:modules ((guix build utils))
531        #:builder
532        (begin
533          (use-modules (guix build utils))
534          (let ((target (string-append (assoc-ref %outputs "out")
535                                       "/share/texmf-dist/fonts/map/fontname")))
536            (mkdir-p target)
537            (copy-recursively (assoc-ref %build-inputs "source") target)
538            #t))))
539     (home-page "https://www.ctan.org/pkg/fontname")
540     (synopsis "Scheme for naming fonts in TeX")
541     (description "This is Fontname, a naming scheme for (the base part of)
542 external TeX font filenames.  This makes at most eight-character names
543 from (almost) arbitrarily complex font names, thus helping portability of TeX
544 documents.")
545     (license license:public-domain)))
547 (define-public texlive-fonts-cm
548   (package
549     (name "texlive-fonts-cm")
550     (version (number->string %texlive-revision))
551     (source (origin
552               (method svn-fetch)
553               (uri (svn-reference
554                     (url (string-append "svn://www.tug.org/texlive/tags/"
555                                         %texlive-tag "/Master/texmf-dist/"
556                                         "/fonts/source/public/cm"))
557                     (revision %texlive-revision)))
558               (file-name (string-append name "-" version "-checkout"))
559               (sha256
560                (base32
561                 "045k5b9rdmbxpy1a3006l1x96z1rd18vg3cwrvnld9bqybw5qz44"))))
562     (build-system gnu-build-system)
563     (arguments
564      `(#:modules ((guix build gnu-build-system)
565                   (guix build utils)
566                   (srfi srfi-1)
567                   (srfi srfi-26))
568        #:tests? #f ; no tests
569        #:phases
570        (modify-phases %standard-phases
571          (delete 'configure)
572          (replace 'build
573            (lambda* (#:key inputs #:allow-other-keys)
574              (let ((mf (assoc-ref inputs "texlive-metafont-base")))
575                ;; Tell mf where to find mf.base
576                (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
577                ;; Tell mf where to look for source files
578                (setenv "MFINPUTS"
579                        (string-append (getcwd) ":"
580                                       mf "/share/texmf-dist/metafont/base")))
581              (mkdir "build")
582              (for-each (lambda (font)
583                          (format #t "building font ~a\n" font)
584                          (invoke "mf" "-progname=mf"
585                                  "-output-directory=build"
586                                  (string-append "\\"
587                                                 "mode:=ljfour; "
588                                                 "mag:=1; "
589                                                 "batchmode; "
590                                                 "input "
591                                                 (basename font ".mf"))))
592                        (find-files "." "cm(.*[0-9]+.*|inch)\\.mf$"))
593              #t))
594          (replace 'install
595            (lambda* (#:key outputs #:allow-other-keys)
596              (let* ((out (assoc-ref outputs "out"))
597                     (tfm (string-append
598                           out "/share/texmf-dist/fonts/tfm/public/cm"))
599                     (mf  (string-append
600                           out "/share/texmf-dist/fonts/source/public/cm")))
601                (for-each (cut install-file <> tfm)
602                          (find-files "build" "\\.*"))
603                (for-each (cut install-file <> mf)
604                          (find-files "." "\\.mf"))
605                #t))))))
606     (native-inputs
607      `(("texlive-bin" ,texlive-bin)
608        ("texlive-metafont-base" ,texlive-metafont-base)))
609     (home-page "https://www.ctan.org/pkg/cm")
610     (synopsis "Computer Modern fonts for TeX")
611     (description "This package provides the Computer Modern fonts by Donald
612 Knuth.  The Computer Modern font family is a large collection of text,
613 display, and mathematical fonts in a range of styles, based on Monotype Modern
614 8A.")
615     (license license:knuth)))
617 (define-public texlive-fonts-knuth-lib
618   (package
619     (name "texlive-fonts-knuth-lib")
620     (version (number->string %texlive-revision))
621     (source (origin
622               (method svn-fetch)
623               (uri (svn-reference
624                     (url (string-append "svn://www.tug.org/texlive/tags/"
625                                         %texlive-tag "/Master/texmf-dist/"
626                                         "/fonts/source/public/knuth-lib"))
627                     (revision %texlive-revision)))
628               (file-name (string-append name "-" version "-checkout"))
629               (sha256
630                (base32
631                 "0in9aqyi8jkyf9d16z0li50z5fpwj1iwgwm83gmvwqcf7chfs04y"))))
632     (build-system gnu-build-system)
633     (arguments
634      `(#:modules ((guix build gnu-build-system)
635                   (guix build utils)
636                   (srfi srfi-26))
637        #:tests? #f ; no tests
638        #:phases
639        (modify-phases %standard-phases
640          (delete 'configure)
641          (replace 'build
642            (lambda* (#:key inputs #:allow-other-keys)
643              (let ((mf (assoc-ref inputs "texlive-metafont-base")))
644                ;; Tell mf where to find mf.base
645                (setenv "MFBASES"
646                        (string-append mf "/share/texmf-dist/web2c"))
647                ;; Tell mf where to look for source files
648                (setenv "MFINPUTS"
649                        (string-append (getcwd) ":"
650                                       mf "/share/texmf-dist/metafont/base")))
651              (mkdir "build")
652              (invoke "mf" "-progname=mf"
653                      "-output-directory=build"
654                      (string-append "\\"
655                                     "mode:=ljfour; "
656                                     "mag:=1; "
657                                     "batchmode; "
658                                     "input manfnt"))))
659          (replace 'install
660            (lambda* (#:key outputs #:allow-other-keys)
661              (let* ((out (assoc-ref outputs "out"))
662                     (tfm (string-append
663                           out "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
664                     (mf  (string-append
665                           out "/share/texmf-dist/fonts/source/public/knuth-lib")))
666                (for-each (cut install-file <> tfm)
667                          (find-files "build" "\\.*"))
668                (for-each (cut install-file <> mf)
669                          (find-files "." "\\.mf"))
670                #t))))))
671     (native-inputs
672      `(("texlive-bin" ,texlive-bin)
673        ("texlive-metafont-base" ,texlive-metafont-base)))
674     (home-page "https://www.ctan.org/pkg/knuth-lib")
675     (synopsis "Small library of METAFONT sources")
676     (description "This is a collection of core TeX and METAFONT macro files
677 from Donald Knuth, including the plain format, plain base, and the MF logo
678 fonts.")
679     (license license:knuth)))
681 (define-public texlive-fonts-latex
682   (package
683     (name "texlive-fonts-latex")
684     (version (number->string %texlive-revision))
685     (source (origin
686               (method svn-fetch)
687               (uri (svn-reference
688                     (url (string-append "svn://www.tug.org/texlive/tags/"
689                                         %texlive-tag "/Master/texmf-dist/"
690                                         "/fonts/source/public/latex-fonts"))
691                     (revision %texlive-revision)))
692               (file-name (string-append name "-" version "-checkout"))
693               (sha256
694                (base32
695                 "0ypsm4xv9cw0jckk2qc7gi9hcmhf31mrg56pz3llyx3yd9vq2lps"))))
696     (build-system gnu-build-system)
697     (arguments
698      `(#:modules ((guix build gnu-build-system)
699                   (guix build utils)
700                   (srfi srfi-1)
701                   (srfi srfi-26))
702        #:tests? #f                      ; no tests
703        #:phases
704        (modify-phases %standard-phases
705          (delete 'configure)
706          (replace 'build
707            (lambda* (#:key inputs #:allow-other-keys)
708              (let ((mf (assoc-ref inputs "texlive-metafont-base")))
709                ;; Tell mf where to find mf.base
710                (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
711                ;; Tell mf where to look for source files
712                (setenv "MFINPUTS"
713                        (string-append (getcwd) ":"
714                                       mf "/share/texmf-dist/metafont/base:"
715                                       (assoc-ref inputs "texlive-fonts-cm")
716                                       "/share/texmf-dist/fonts/source/public/cm")))
717              (mkdir "build")
718              (for-each (lambda (font)
719                          (format #t "building font ~a\n" font)
720                          (invoke "mf" "-progname=mf"
721                                  "-output-directory=build"
722                                  (string-append "\\"
723                                                 "mode:=ljfour; "
724                                                 "mag:=1; "
725                                                 "batchmode; "
726                                                 "input " font)))
727                        '("icmcsc10" "icmex10" "icmmi8" "icmsy8" "icmtt8"
728                          "ilasy8" "ilcmss8" "ilcmssb8" "ilcmssi8"
729                          "lasy5" "lasy6" "lasy7" "lasy8" "lasy9" "lasy10" "lasyb10"
730                          "lcircle10" "lcirclew10" "lcmss8" "lcmssb8" "lcmssi8"
731                          "line10" "linew10"))
732              #t))
733          (replace 'install
734            (lambda* (#:key outputs #:allow-other-keys)
735              (let* ((out (assoc-ref outputs "out"))
736                     (tfm (string-append
737                           out "/share/texmf-dist/fonts/tfm/public/latex-fonts"))
738                     (mf  (string-append
739                           out "/share/texmf-dist/fonts/source/public/latex-fonts")))
740                (for-each (cut install-file <> tfm)
741                          (find-files "build" "\\.*"))
742                (for-each (cut install-file <> mf)
743                          (find-files "." "\\.mf"))
744                #t))))))
745     (native-inputs
746      `(("texlive-bin" ,texlive-bin)
747        ("texlive-metafont-base" ,texlive-metafont-base)
748        ("texlive-fonts-cm" ,texlive-fonts-cm)))
749     (home-page "https://www.ctan.org/pkg/latex-fonts")
750     (synopsis "Collection of fonts used in LaTeX distributions")
751     (description "This is a collection of fonts for use with standard LaTeX
752 packages and classes. It includes invisible fonts (for use with the slides
753 class), line and circle fonts (for use in the picture environment) and LaTeX
754 symbol fonts.")
755     (license license:lppl1.2+)))
757 (define-public texlive-fonts-amsfonts
758   (package
759     (name "texlive-fonts-amsfonts")
760     (version (number->string %texlive-revision))
761     (source (origin
762               (method svn-fetch)
763               (uri (svn-reference
764                     (url (string-append "svn://www.tug.org/texlive/tags/"
765                                         %texlive-tag "/Master/texmf-dist/"
766                                         "/fonts/source/public/amsfonts"))
767                     (revision %texlive-revision)))
768               (file-name (string-append name "-" version "-checkout"))
769               (sha256
770                (base32
771                 "07h20rvpbdb4k72hzmjkyb29426zr9wxsfp6yd4ajbbpd3vx8grb"))))
772     (build-system gnu-build-system)
773     (arguments
774      `(#:modules ((guix build gnu-build-system)
775                   (guix build utils)
776                   (srfi srfi-1)
777                   (srfi srfi-26))
778        #:tests? #f                      ; no tests
779        #:phases
780        (modify-phases %standard-phases
781          (delete 'configure)
782          (replace 'build
783            (lambda* (#:key inputs #:allow-other-keys)
784              (let ((mf (assoc-ref inputs "texlive-metafont-base"))
785                    (cwd (getcwd)))
786                ;; Make METAFONT reproducible
787                (setenv "SOURCE_DATE_EPOCH" "1")
788                ;; Tell mf where to find mf.base
789                (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
790                ;; Tell mf where to look for source files
791                (setenv "MFINPUTS"
792                        (string-append cwd ":"
793                                       cwd "/cmextra:"
794                                       cwd "/cyrillic:"
795                                       cwd "/dummy:"
796                                       cwd "/symbols:"
797                                       mf "/share/texmf-dist/metafont/base:"
798                                       (assoc-ref inputs "texlive-fonts-cm")
799                                       "/share/texmf-dist/fonts/source/public/cm")))
800              (mkdir "build")
801              (for-each (lambda (font)
802                          (format #t "building font ~a\n" (basename font ".mf"))
803                          (with-directory-excursion (dirname font)
804                            (invoke "mf" "-progname=mf"
805                                    "-output-directory=../build"
806                                    (string-append "\\"
807                                                   "mode:=ljfour; "
808                                                   "mag:=1; "
809                                                   "nonstopmode; "
810                                                   "input "
811                                                   (getcwd) "/"
812                                                   (basename font ".mf")))))
813                        (find-files "." "[0-9]+\\.mf$"))
814              #t))
815          (replace 'install
816            (lambda* (#:key outputs #:allow-other-keys)
817              (let* ((out (assoc-ref outputs "out"))
818                     (tfm (string-append
819                           out "/share/texmf-dist/fonts/tfm/public/amsfonts"))
820                     (mf  (string-append
821                           out "/share/texmf-dist/fonts/source/public/amsfonts")))
822                (for-each (cut install-file <> tfm)
823                          (find-files "build" "\\.*"))
824                (for-each (cut install-file <> mf)
825                          (find-files "." "\\.mf"))
826                #t))))))
827     (native-inputs
828      `(("texlive-fonts-cm" ,texlive-fonts-cm)
829        ("texlive-metafont-base" ,texlive-metafont-base)
830        ("texlive-bin" ,texlive-bin)))
831     (home-page "https://www.ctan.org/pkg/amsfonts")
832     (synopsis "TeX fonts from the American Mathematical Society")
833     (description
834      "This package provides an extended set of fonts for use in mathematics,
835 including: extra mathematical symbols; blackboard bold letters (uppercase
836 only); fraktur letters; subscript sizes of bold math italic and bold Greek
837 letters; subscript sizes of large symbols such as sum and product; added sizes
838 of the Computer Modern small caps font; cyrillic fonts (from the University of
839 Washington); Euler mathematical fonts.  All fonts are provided as Adobe Type 1
840 files, and all except the Euler fonts are provided as Metafont source.  The
841 distribution also includes the canonical Type 1 versions of the Computer
842 Modern family of fonts.  The Euler fonts are supported by separate packages;
843 details can be found in the documentation.")
844     (license license:silofl1.1)))
846 (define-public texlive-latex-amsfonts
847   (package
848     (name "texlive-latex-amsfonts")
849     (version (number->string %texlive-revision))
850     (source (origin
851               (method svn-fetch)
852               (uri (texlive-ref "latex" "amsfonts"))
853               (file-name (string-append name "-" version "-checkout"))
854               (sha256
855                (base32
856                 "0slzfv5h2m03b2xvm2sasznz4azh6rgi069z161dja3l8rln79hm"))))
857     (build-system texlive-build-system)
858     (arguments '(#:tex-directory "latex/amsfonts"))
859     (native-inputs
860      `(("texlive-fonts-cm" ,texlive-fonts-cm)
861        ("texlive-metafont-base" ,texlive-metafont-base)))
862     (home-page "https://www.ctan.org/pkg/amsfonts")
863     (synopsis "TeX fonts from the American Mathematical Society")
864     (description
865      "This package provides basic LaTeX support for the symbol fonts provides
866 by the amsfonts package.  It provides @code{amsfonts.sty}, with names of
867 individual symbols defined in @code{amssymb.sty}.")
868     (license license:silofl1.1)))
870 ;; This provides etex.src which is needed to build various formats, including
871 ;; luatex.fmt and pdflatex.fmt
872 (define-public texlive-tex-plain
873   (package
874     (name "texlive-tex-plain")
875     (version (number->string %texlive-revision))
876     (source (origin
877               (method svn-fetch)
878               (uri (svn-reference
879                     (url (string-append "svn://www.tug.org/texlive/tags/"
880                                         %texlive-tag "/Master/texmf-dist/"
881                                         "/tex/plain"))
882                     (revision %texlive-revision)))
883               (file-name (string-append name "-" version "-checkout"))
884               (sha256
885                (base32
886                 "0mjgl3gscn3ps29yjambz1j9fg81ynnncb96vpprwx4xsijhsns0"))))
887     (build-system trivial-build-system)
888     (arguments
889      `(#:modules ((guix build utils))
890        #:builder
891        (begin
892          (use-modules (guix build utils))
893          (let ((target (string-append (assoc-ref %outputs "out")
894                                       "/share/texmf-dist/tex/plain")))
895            (mkdir-p target)
896            (copy-recursively (assoc-ref %build-inputs "source") target)
897            #t))))
898     (home-page "https://www.ctan.org/pkg/plain")
899     (synopsis "Plain TeX format and supporting files")
900     (description
901      "Contains files used to build the Plain TeX format, as described in the
902 TeXbook, together with various supporting files (some also discussed in the
903 book).")
904     (license license:knuth)))
906 (define-public texlive-latex-base
907   (let ((texlive-dir
908          (lambda (dir hash)
909            (origin
910              (method svn-fetch)
911              (uri (svn-reference
912                    (url (string-append "svn://www.tug.org/texlive/tags/"
913                                        %texlive-tag "/Master/texmf-dist/"
914                                        dir))
915                    (revision %texlive-revision)))
916              (file-name (string-append "texlive-generic-"
917                                        (last (string-split
918                                                (string-drop-right dir 1) #\/))
919                                        "-" (number->string %texlive-revision)
920                                        "-checkout"))
921              (sha256 (base32 hash))))))
922     (package
923       (name "texlive-latex-base")
924       (version (number->string %texlive-revision))
925       (source (origin
926                 (method svn-fetch)
927                 (uri (texlive-ref "latex" "base"))
928                 (file-name (string-append name "-" version "-checkout"))
929                 (sha256
930                  (base32
931                   "1h9pir2hz6i9avc4lrl733p3zf4rpkg8537x1zdbhs91hvhikw9k"))))
932       (build-system gnu-build-system)
933       (arguments
934        `(#:modules ((guix build gnu-build-system)
935                     (guix build utils)
936                     (ice-9 match)
937                     (srfi srfi-1)
938                     (srfi srfi-26))
939          #:tests? #f                    ; no tests
940          #:phases
941          (modify-phases %standard-phases
942            (delete 'configure)
943            (replace 'build
944              (lambda* (#:key inputs #:allow-other-keys)
945                ;; Find required fonts
946                (setenv "TFMFONTS"
947                        (string-append (assoc-ref inputs "texlive-fonts-cm")
948                                       "/share/texmf-dist/fonts/tfm/public/cm:"
949                                       (assoc-ref inputs "texlive-fonts-latex")
950                                       "/share/texmf-dist/fonts/tfm/public/latex-fonts:"
951                                       (assoc-ref inputs "texlive-fonts-knuth-lib")
952                                       "/share/texmf-dist/fonts/tfm/public/knuth-lib"))
953                (setenv "TEXINPUTS"
954                        (string-append
955                         (getcwd) ":"
956                         (getcwd) "/build:"
957                         (string-join
958                          (append-map (match-lambda
959                                        ((_ . dir)
960                                         (find-files dir
961                                                     (lambda (_ stat)
962                                                       (eq? 'directory (stat:type stat)))
963                                                     #:directories? #t
964                                                     #:stat stat)))
965                                      inputs)
966                          ":")))
968                ;; Create an empty texsys.cfg, because latex.ltx wants to include
969                ;; it.  This file must exist and it's fine if it's empty.
970                (with-output-to-file "texsys.cfg"
971                  (lambda _ (format #t "%")))
973                (mkdir "build")
974                (mkdir "web2c")
975                (invoke "luatex" "-ini" "-interaction=batchmode"
976                        "-output-directory=build" "unpack.ins")
977                (invoke "tex" "-ini" "-interaction=batchmode"
978                        "-output-directory=web2c" "tex.ini")
979                ;; LaTeX, pdfetex/pdftex, and XeTeX require e-TeX, which
980                ;; is enabled only in extended mode (activated with a
981                ;; leading asterisk).  We should not use luatex here,
982                ;; because that would make the generated format files
983                ;; incompatible with any other TeX engine.
984                (for-each (lambda (format)
985                            (invoke "latex" "-ini" "-interaction=batchmode"
986                                    "-output-directory=web2c"
987                                    "-translate-file=cp227.tcx"
988                                    (string-append "*" format ".ini")))
989                          '("latex"
990                            "pdflatex"
991                            "pdfetex"))
992                (for-each (lambda (format)
993                            (invoke format "-ini" "-interaction=batchmode"
994                                    "-output-directory=web2c"
995                                    (string-append "*" format ".ini")))
996                          '("xetex"
997                            "xelatex"))
998                (for-each (lambda (format)
999                            (invoke "luatex" "-ini" "-interaction=batchmode"
1000                                    "-output-directory=web2c"
1001                                    (string-append format ".ini")))
1002                          '("dviluatex" "dvilualatex" "luatex" "lualatex"))
1003                #t))
1004            (replace 'install
1005              (lambda* (#:key outputs #:allow-other-keys)
1006                (let* ((out (assoc-ref outputs "out"))
1007                       (target (string-append
1008                                out "/share/texmf-dist/tex/latex/base"))
1009                       (web2c (string-append
1010                               out "/share/texmf-dist/web2c")))
1011                  (mkdir-p target)
1012                  (mkdir-p web2c)
1013                  (for-each delete-file (find-files "." "\\.(log|aux)$"))
1014                  (for-each (cut install-file <> target)
1015                            (find-files "build" ".*"))
1016                  (for-each (cut install-file <> web2c)
1017                            (find-files "web2c" ".*"))
1018                  ;; pdftex is really just the same as pdfetex, but since it
1019                  ;; doesn't have its own format file, we need to copy it.
1020                  (copy-file "web2c/pdfetex.fmt"
1021                             (string-append web2c "/pdftex.fmt"))
1022                  #t))))))
1023       (native-inputs
1024        `(("texlive-bin" ,texlive-bin)
1025          ("texlive-generic-unicode-data" ,texlive-generic-unicode-data)
1026          ("texlive-generic-dehyph-exptl" ,texlive-generic-dehyph-exptl)
1027          ("texlive-generic-tex-ini-files" ,texlive-generic-tex-ini-files)
1028          ("texlive-latex-latexconfig"
1029           ,(texlive-dir "tex/latex/latexconfig/"
1030                         "1zb3j49cj8p75yph6c8iysjp7qbdvghwf0mn9j0l7qq3qkbz2xaf"))
1031          ("texlive-generic-hyph-utf8" ,texlive-generic-hyph-utf8)
1032          ("texlive-generic-hyphen"
1033           ,(texlive-dir "tex/generic/hyphen/"
1034                         "0xim36wybw2625yd0zwlp9m2c2xrcybw58gl4rih9nkph0wqwwhd"))
1035          ("texlive-generic-ruhyphen"
1036           ,(texlive-dir "tex/generic/ruhyphen/"
1037                         "14rjkpl4zkjqs13rcf9kcd24mn2kx7i1jbdwxq8ds94bi66ylzsd"))
1038          ("texlive-generic-ukrhyph"
1039           ,(texlive-dir "tex/generic/ukrhyph/"
1040                         "1cfwdg2rhbayl3w0x1xqd36d45zbc96f029myp13s7cb6kbmbppv"))
1041          ("texlive-generic-config"
1042           ,(texlive-dir "tex/generic/config/"
1043                         "19vj088p4kkp6xll0141m4kl6ssgdzhs3g10i232khb07aqiag8s"))
1044          ("texlive-tex-plain" ,texlive-tex-plain)
1045          ("texlive-fonts-cm" ,texlive-fonts-cm)
1046          ("texlive-fonts-latex" ,texlive-fonts-latex)
1047          ("texlive-fonts-knuth-lib" ,texlive-fonts-knuth-lib)))
1048       (home-page "https://www.ctan.org/pkg/latex-base")
1049       (synopsis "Base sources of LaTeX")
1050       (description
1051        "This bundle comprises the source of LaTeX itself, together with several
1052 packages which are considered \"part of the kernel\".  This bundle, together
1053 with the required packages, constitutes what every LaTeX distribution should
1054 contain.")
1055       (license license:lppl1.3c+))))
1057 (define-public texlive-latex-filecontents
1058   (package
1059     (name "texlive-latex-filecontents")
1060     (version (number->string %texlive-revision))
1061     (source (origin
1062               (method svn-fetch)
1063               (uri (texlive-ref "latex" "filecontents"))
1064               (file-name (string-append name "-" version "-checkout"))
1065               (sha256
1066                (base32
1067                 "0swkbxv8vg0yizadfnvrwjb4cj0pn34v9wm6v7wqq903fdav7k7q"))))
1068     (build-system texlive-build-system)
1069     (arguments '(#:tex-directory "latex/filecontents"))
1070     (home-page "https://www.ctan.org/pkg/filecontents")
1071     (synopsis "Extended filecontents and filecontents* environments")
1072     (description
1073      "LaTeX2e's @code{filecontents} and @code{filecontents*} environments
1074 enable a LaTeX source file to generate external files as it runs through
1075 LaTeX.  However, there are two limitations of these environments: they refuse
1076 to overwrite existing files, and they can only be used in the preamble of a
1077 document.  The filecontents package removes these limitations, letting you
1078 overwrite existing files and letting you use @code{filecontents} /
1079 @code{filecontents*} anywhere.")
1080     (license license:lppl1.3c+)))
1082 (define-public texlive-generic-ifxetex
1083   (package
1084     (name "texlive-generic-ifxetex")
1085     (version (number->string %texlive-revision))
1086     (source (origin
1087               (method svn-fetch)
1088               (uri (texlive-ref "generic" "ifxetex"))
1089               (file-name (string-append name "-" version "-checkout"))
1090               (sha256
1091                (base32
1092                 "0w2xj7n0szavj329kds09q626szkc378p3w0sk022q0ln4ksz86d"))))
1093     (build-system texlive-build-system)
1094     (arguments
1095      '(#:tex-directory "generic/ifxetex"
1096        #:tex-format "xelatex"))
1097     (inputs
1098      `(("texlive-latex-filecontents" ,texlive-latex-filecontents)))
1099     (home-page "https://www.ctan.org/pkg/ifxetex")
1100     (synopsis "Am I running under XeTeX?")
1101     (description
1102      "This is a simple package which provides an @code{\\ifxetex} conditional,
1103 so that other code can determine that it is running under XeTeX.  The package
1104 requires the e-TeX extensions to the TeX primitive set.")
1105     (license license:lppl1.3c+)))
1107 (define-public texlive-generic-epsf
1108   (package
1109     (name "texlive-generic-epsf")
1110     (version (number->string %texlive-revision))
1111     (source (origin
1112               (method svn-fetch)
1113               (uri (svn-reference
1114                     (url (string-append "svn://www.tug.org/texlive/tags/"
1115                                         %texlive-tag "/Master/texmf-dist/"
1116                                         "/tex/generic/epsf"))
1117                     (revision %texlive-revision)))
1118               (file-name (string-append name "-" version "-checkout"))
1119               (sha256
1120                (base32
1121                 "14w3j81ympyvg8hkk9i1xgr8a0gfnfsb2ki8qqsk5pa051za1xcy"))))
1122     (build-system trivial-build-system)
1123     (arguments
1124      `(#:modules ((guix build utils))
1125        #:builder
1126        (begin
1127          (use-modules (guix build utils))
1128          (let ((target (string-append (assoc-ref %outputs "out")
1129                                       "/share/texmf-dist/tex/generic/epfs")))
1130            (mkdir-p target)
1131            (copy-recursively (assoc-ref %build-inputs "source") target)
1132            #t))))
1133     (home-page "https://www.ctan.org/pkg/epsf")
1134     (synopsis "Simple macros for EPS inclusion")
1135     (description
1136      "This package provides the original (and now obsolescent) graphics
1137 inclusion macros for use with dvips, still widely used by Plain TeX users (in
1138 particular).  For LaTeX users, the package is nowadays (rather strongly)
1139 deprecated in favour of the more sophisticated standard LaTeX latex-graphics
1140 bundle of packages.  (The latex-graphics bundle is also available to Plain TeX
1141 users, via its Plain TeX version.)")
1142     (license license:public-domain)))
1144 (define-public texlive-latex-fancyvrb
1145   (package
1146     (name "texlive-latex-fancyvrb")
1147     (version (number->string %texlive-revision))
1148     (source (origin
1149               (method svn-fetch)
1150               (uri (texlive-ref "latex" "fancyvrb"))
1151               (file-name (string-append name "-" version "-checkout"))
1152               (sha256
1153                (base32
1154                 "03l7140y031rr14h02i4z9zqsfvrbn7wzwxbjsrjcgrk6sdr71wv"))))
1155     (build-system texlive-build-system)
1156     (arguments
1157      '(#:tex-directory "latex/fancyvrb"
1158        ;; We exclude "fvrb-ex" to avoid a dependency on texlive-luaotfload and
1159        ;; thus texlive-luatex-lualibs.
1160        #:build-targets '("fancyvrb.ins")))
1161     (home-page "https://www.ctan.org/pkg/fancyvrb")
1162     (synopsis "Sophisticated verbatim text")
1163     (description
1164      "This package provides tools for the flexible handling of verbatim text
1165 including: verbatim commands in footnotes; a variety of verbatim environments
1166 with many parameters; ability to define new customized verbatim environments;
1167 save and restore verbatim text and environments; write and read files in
1168 verbatim mode; build \"example\" environments (showing both result and
1169 verbatim source).")
1170     (license license:lppl1.0+)))
1172 (define-public texlive-latex-graphics
1173   (package
1174     (name "texlive-latex-graphics")
1175     (version (number->string %texlive-revision))
1176     (source (origin
1177               (method svn-fetch)
1178               (uri (texlive-ref "latex" "graphics"))
1179               (file-name (string-append name "-" version "-checkout"))
1180               (sha256
1181                (base32
1182                 "07azyn0b1s49vbdlr6dmygrminxp72ndl24j1091hiiccvrjq3xc"))))
1183     (build-system texlive-build-system)
1184     (arguments
1185      '(#:tex-directory "latex/graphics"
1186        #:phases
1187        (modify-phases %standard-phases
1188          (add-after 'install 'install-config
1189            (lambda* (#:key inputs outputs #:allow-other-keys)
1190              (let ((cfg (assoc-ref inputs "graphics-cfg"))
1191                    (target (string-append (assoc-ref outputs "out")
1192                                           "/share/texmf-dist/tex/latex/graphics-cfg")))
1193                (mkdir-p target)
1194                (install-file (string-append cfg "/graphics.cfg") target)
1195                (install-file (string-append cfg "/color.cfg")    target)
1196                #t)))
1197          (add-after 'install 'install-defs
1198            (lambda* (#:key inputs outputs #:allow-other-keys)
1199              (let ((def (assoc-ref inputs "graphics-def"))
1200                    (target (string-append (assoc-ref outputs "out")
1201                                           "/share/texmf-dist/tex/latex/graphics-def")))
1202                (mkdir-p target)
1203                (copy-recursively def target)
1204                #t))))))
1205     (native-inputs
1206      `(("graphics-cfg"
1207         ,(origin
1208            (method git-fetch)
1209            (uri (git-reference
1210                  (url "https://github.com/latex3/graphics-cfg.git")
1211                  (commit "19d1238af17df376cd46333b229579b0f7f3a41f")))
1212            (file-name (string-append "graphics-cfg-"
1213                                      (number->string %texlive-revision)
1214                                      "-checkout"))
1215            (sha256
1216             (base32
1217              "12kbgbm52gmmgn8zajb74s8n5rvnxcfdvs3iyj8vcw5vrsw5i6mh"))))
1218        ("graphics-def"
1219         ,(origin
1220            (method svn-fetch)
1221            (uri (svn-reference
1222                  (url (string-append "svn://www.tug.org/texlive/tags/"
1223                                      %texlive-tag "/Master/texmf-dist/"
1224                                      "/tex/latex/graphics-def"))
1225                  (revision %texlive-revision)))
1226            (file-name (string-append "graphics-def-"
1227                                      (number->string %texlive-revision)
1228                                      "-checkout"))
1229            (sha256
1230             (base32
1231              "0gi4qv6378nl84s8n1yx3hjqvv7r4lza7hpbymbl5rzwgw8qrnyb"))))))
1232     (home-page "https://www.ctan.org/pkg/latex-graphics")
1233     (synopsis "LaTeX standard graphics bundle")
1234     (description
1235      "This is a collection of LaTeX packages for producing color, including
1236 graphics (e.g. PostScript) files, and rotation and scaling of text in LaTeX
1237 documents.  It comprises the packages color, graphics, graphicx, trig, epsfig,
1238 keyval, and lscape.")
1239     ;; The configuration files are released under CC0.
1240     (license (list license:lppl1.3c+
1241                    license:cc0))))
1243 (define-public texlive-latex-xcolor
1244   (package
1245     (name "texlive-latex-xcolor")
1246     (version (number->string %texlive-revision))
1247     (source (origin
1248               (method svn-fetch)
1249               (uri (texlive-ref "latex" "xcolor"))
1250               (file-name (string-append name "-" version "-checkout"))
1251               (sha256
1252                (base32
1253                 "01n613s7bcrd2n4jfawm0k4nn2ny3aaifp2jjfif3lz4sbv31494"))))
1254     (build-system texlive-build-system)
1255     (arguments '(#:tex-directory "latex/xcolor"))
1256     (home-page "https://www.ctan.org/pkg/xcolor")
1257     (synopsis "Driver-independent color extensions for LaTeX and pdfLaTeX")
1258     (description
1259      "The package starts from the basic facilities of the colorcolor package,
1260 and provides easy driver-independent access to several kinds of color tints,
1261 shades, tones, and mixes of arbitrary colors.  It allows a user to select a
1262 document-wide target color model and offers complete tools for conversion
1263 between eight color models.  Additionally, there is a command for alternating
1264 row colors plus repeated non-aligned material (like horizontal lines) in
1265 tables.")
1266     (license license:lppl1.2+)))
1268 (define-public texlive-latex-hyperref
1269   (package
1270     (name "texlive-latex-hyperref")
1271     (version "6.84a2")
1272     ;; The sources in the TeX Live SVN repository do not contain hluatex.dtx,
1273     ;; so we fetch the release from GitHub.
1274     (source (origin
1275               (method url-fetch)
1276               (uri (string-append "https://github.com/ho-tex/hyperref/"
1277                                   "archive/release-" version ".tar.gz"))
1278               (file-name (string-append name "-" version ".tar.gz"))
1279               (sha256
1280                (base32
1281                 "1d3rmjgzh0025a1dza55zb6nzzlgd1y9snwx45wq1c1vf42m79h2"))))
1282     (build-system texlive-build-system)
1283     (arguments '(#:tex-directory "latex/hyperref"))
1284     (home-page "https://www.ctan.org/pkg/hyperref")
1285     (synopsis "Extensive support for hypertext in LaTeX")
1286     (description
1287      "The @code{hyperref} package is used to handle cross-referencing commands
1288 in LaTeX to produce hypertext links in the document.  The package provides
1289 backends for the @code{\\special} set defined for HyperTeX DVI processors; for
1290 embedded @code{pdfmark} commands for processing by Acrobat
1291 Distiller (@code{dvips} and Y&Y's @code{dvipsone}); for Y&Y's @code{dviwindo};
1292 for PDF control within pdfTeX and @code{dvipdfm}; for TeX4ht; and for VTeX's
1293 pdf and HTML backends.  The package is distributed with the @code{backref} and
1294 @code{nameref} packages, which make use of the facilities of @code{hyperref}.")
1295     (license license:lppl1.3+)))
1297 (define-public texlive-latex-oberdiek
1298   (package
1299     (name "texlive-latex-oberdiek")
1300     (version (number->string %texlive-revision))
1301     (source (origin
1302               (method svn-fetch)
1303               (uri (texlive-ref "latex" "oberdiek"))
1304               (file-name (string-append name "-" version "-checkout"))
1305               (sha256
1306                (base32
1307                 "0aswvsxgsn709xmvpcg50d2xl7vcy1ckdxb9c1cligqqfjjvviqf"))))
1308     (build-system texlive-build-system)
1309     (arguments
1310      '(#:tex-directory "latex/oberdiek"
1311        #:build-targets '("oberdiek.ins")
1312        #:phases
1313        (modify-phases %standard-phases
1314          ;; "ifpdf.ins" is not generated, so we need to process the dtx file.
1315          (add-after 'unpack 'do-not-process-ifpdf.ins
1316            (lambda _
1317              (substitute* "oberdiek.ins"
1318                (("ifpdf.ins") "ifpdf.dtx"))
1319              #t)))))
1320     (home-page "https://www.ctan.org/pkg/oberdiek")
1321     (synopsis "Bundle of packages submitted by Heiko Oberdiek")
1322     (description
1323      "The bundle comprises various LaTeX packages, providing among others:
1324 better accessibility support for PDF files; extensible chemists reaction
1325 arrows; record information about document class(es) used; and many more.")
1326     (license license:lppl1.3+)))
1328 (define-public texlive-latex-tools
1329   (package
1330     (name "texlive-latex-tools")
1331     (version (number->string %texlive-revision))
1332     (source (origin
1333               (method svn-fetch)
1334               (uri (texlive-ref "latex" "tools"))
1335               (file-name (string-append name "-" version "-checkout"))
1336               (sha256
1337                (base32
1338                 "052a0pch2k5zls5jlay9xxcf93rw3i60a2x28y3ip3rhbsv3xgiz"))))
1339     (build-system texlive-build-system)
1340     (arguments
1341      '(#:tex-directory "latex/tools"
1342        #:build-targets '("tools.ins")))
1343     (home-page "https://www.ctan.org/pkg/latex-tools")
1344     (synopsis "LaTeX standard tools bundle")
1345     (description
1346      "This package is a collection of (variously) simple tools provided as
1347 part of the LaTeX required tools distribution, comprising the following
1348 packages: afterpage, array, bm, calc, dcolumn, delarray, enumerate, fileerr,
1349 fontsmpl, ftnright, hhline, indentfirst, layout, longtable, multicol,
1350 rawfonts, showkeys, somedefs, tabularx, theorem, trace, varioref, verbatim,
1351 xr, and xspace.")
1352     (license license:lppl1.3+)))
1354 (define-public texlive-latex-url
1355   (package
1356     (name "texlive-latex-url")
1357     (version (number->string %texlive-revision))
1358     (source (origin
1359               (method svn-fetch)
1360               (uri (svn-reference
1361                     (url (string-append "svn://www.tug.org/texlive/tags/"
1362                                         %texlive-tag "/Master/texmf-dist/"
1363                                         "/tex/latex/url"))
1364                     (revision %texlive-revision)))
1365               (file-name (string-append name "-" version "-checkout"))
1366               (sha256
1367                (base32
1368                 "184s2543cwia5l7iibhlkl1ffbncfhjpv5p56zq0c15by5sghlac"))))
1369     (build-system trivial-build-system)
1370     (arguments
1371      `(#:modules ((guix build utils))
1372        #:builder
1373        (begin
1374          (use-modules (guix build utils))
1375          (let ((target (string-append (assoc-ref %outputs "out")
1376                                       "/share/texmf-dist/tex/latex/url")))
1377            (mkdir-p target)
1378            (copy-recursively (assoc-ref %build-inputs "source") target)
1379            #t))))
1380     (home-page "https://www.ctan.org/pkg/url")
1381     (synopsis "Verbatim with URL-sensitive line breaks")
1382     (description "The command @code{\\url} is a form of verbatim command that
1383 allows linebreaks at certain characters or combinations of characters, accepts
1384 reconfiguration, and can usually be used in the argument to another command.
1385 The command is intended for email addresses, hypertext links,
1386 directories/paths, etc., which normally have no spaces, so by default the
1387 package ignores spaces in its argument.  However, a package option allows
1388 spaces, which is useful for operating systems where spaces are a common part
1389 of file names.")
1390     ;; The license header states that it is under LPPL version 2 or later, but
1391     ;; the latest version is 1.3c.
1392     (license license:lppl1.3c+)))
1394 (define-public texlive-latex-l3kernel
1395   (package
1396     (name "texlive-latex-l3kernel")
1397     (version (number->string %texlive-revision))
1398     (source (origin
1399               (method svn-fetch)
1400               (uri (texlive-ref "latex" "l3kernel"))
1401               (file-name (string-append name "-" version "-checkout"))
1402               (sha256
1403                (base32
1404                 "0r0wfk594j8wkdqhh21haimwsfq8x5jch4ldm21hkzk5dnmvpbg6"))))
1405     (build-system texlive-build-system)
1406     (arguments
1407      '(#:tex-directory "latex/l3kernel"))
1408     (home-page "https://www.ctan.org/pkg/l3kernel")
1409     (synopsis "LaTeX3 programmers’ interface")
1410     (description
1411      "The l3kernel bundle provides an implementation of the LaTeX3
1412 programmers’ interface, as a set of packages that run under LaTeX 2e.  The
1413 interface provides the foundation on which the LaTeX3 kernel and other future
1414 code are built: it is an API for TeX programmers.  The packages are set up so
1415 that the LaTeX3 conventions can be used with regular LaTeX 2e packages.")
1416     (license license:lppl1.3c+)))
1418 (define-public texlive-latex-l3packages
1419   (package
1420     (name "texlive-latex-l3packages")
1421     (version (number->string %texlive-revision))
1422     (source (origin
1423               (method svn-fetch)
1424               (uri (texlive-ref "latex" "l3packages"))
1425               (file-name (string-append name "-" version "-checkout"))
1426               (sha256
1427                (base32
1428                 "16jplkvzdysfssijq9l051nsks65c2nrarsl17k8gjhc28yznj8y"))))
1429     (build-system texlive-build-system)
1430     (arguments
1431      '(#:tex-directory "latex/l3packages"
1432        #:phases
1433        (modify-phases %standard-phases
1434          ;; All package sources are in sub-directories, so we need to add them
1435          ;; to TEXINPUTS.
1436          (add-after 'unpack 'set-TEXINPUTS
1437            (lambda _
1438              (let ((cwd (getcwd)))
1439                (setenv "TEXINPUTS"
1440                        (string-append cwd "/l3keys2e:"
1441                                       cwd "/xparse:"
1442                                       cwd "/xfrac:"
1443                                       cwd "/xfp:"
1444                                       cwd "/xtemplate")))
1445              #t)))))
1446     (inputs
1447      `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1448     (home-page "https://www.ctan.org/pkg/l3packages")
1449     (synopsis "High-level LaTeX3 concepts")
1450     (description
1451      "This bundle holds prototype implementations of concepts for a LaTeX
1452 designer interface, to be used with the experimental LaTeX kernel as
1453 programming tools and kernel sup­port.  Packages provided in this release are:
1455 @enumerate
1456 @item l3keys2e, which makes the facilities of the kernel module l3keys
1457   available for use by LaTeX 2e packages;
1458 @item xfrac, which provides flexible splitlevel fractions;
1459 @item xparse, which provides a high-level interface for declaring document
1460   commands; and
1461 @item xtemplate, which provides a means of defining generic functions using a
1462   key-value syntax.
1463 @end enumerate\n")
1464     (license license:lppl1.3c+)))
1466 (define-public texlive-latex-fontspec
1467   (package
1468     (name "texlive-latex-fontspec")
1469     (version (number->string %texlive-revision))
1470     (source (origin
1471               (method svn-fetch)
1472               (uri (texlive-ref "latex" "fontspec"))
1473               (file-name (string-append name "-" version "-checkout"))
1474               (sha256
1475                (base32
1476                 "1rx43y5xmjqvc27pjdnmqwp4pcw3czcfd6nfpmzc1gnqfl1hlc0q"))))
1477     (build-system texlive-build-system)
1478     (arguments
1479      '(#:tex-directory "latex/fontspec"
1480        #:build-targets '("fontspec.dtx")))
1481     (inputs
1482      `(("texlive-latex-l3kernel" ,texlive-latex-l3kernel)))
1483     (home-page "https://www.ctan.org/pkg/fontspec")
1484     (synopsis "Advanced font selection in XeLaTeX and LuaLaTeX")
1485     (description
1486      "Fontspec is a package for XeLaTeX and LuaLaTeX.  It provides an
1487 automatic and unified interface to feature-rich AAT and OpenType fonts through
1488 the NFSS in LaTeX running on XeTeX or LuaTeX engines.  The package requires
1489 the l3kernel and xparse bundles from the LaTeX 3 development team.")
1490     (license license:lppl1.3+)))
1492 ;; The SVN directory contains little more than a dtx file that generates three
1493 ;; of the many lua files that should be installed as part of this package.
1494 ;; This is why we take the release from GitHub instead.
1495 (define-public texlive-luatex-lualibs
1496   (package
1497     (name "texlive-luatex-lualibs")
1498     (version "2.5")
1499     (source (origin
1500               (method url-fetch)
1501               (uri (string-append "https://github.com/lualatex/lualibs/"
1502                                   "releases/download/v"
1503                                   version "/lualibs.zip"))
1504               (file-name (string-append name "-" version ".zip"))
1505               (sha256
1506                (base32
1507                 "1xx9blvrmx9hyhrl345lpai9m6xxnw997261a1ahn1bm5r2j5fqy"))))
1508     (build-system gnu-build-system)
1509     (arguments
1510      `(#:make-flags
1511        (list (string-append "DESTDIR="
1512                             (assoc-ref %outputs "out")
1513                             "/share/texmf-dist"))
1514        #:phases
1515        (modify-phases %standard-phases
1516          (delete 'configure))))
1517     (native-inputs
1518      `(("texlive-bin" ,texlive-bin)
1519        ("unzip" ,unzip)
1520        ("zip" ,zip)))
1521     (home-page "https://github.com/lualatex/lualibs")
1522     (synopsis "Lua modules for general programming (in the (La)TeX world)")
1523     (description
1524      "Lualibs is a collection of Lua modules useful for general programming.
1525 The bundle is based on Lua modules shipped with ConTeXt, and made available in
1526 this bundle for use independent of ConTeXt.")
1527     ;; GPL version 2 only
1528     (license license:gpl2)))
1530 (define-public texlive-latex-amsmath
1531   (package
1532     (name "texlive-latex-amsmath")
1533     (version (number->string %texlive-revision))
1534     (source (origin
1535               (method svn-fetch)
1536               (uri (texlive-ref "latex" "amsmath"))
1537               (file-name (string-append name "-" version "-checkout"))
1538               (sha256
1539                (base32
1540                 "178ywjpdlv78qmfzqdyn6gy14620zjsn2q9wap76fbr9s4hw6dba"))))
1541     (build-system texlive-build-system)
1542     (arguments '(#:tex-directory "latex/amsmath"))
1543     (home-page "https://www.ctan.org/pkg/amsmath")
1544     (synopsis "AMS mathematical facilities for LaTeX")
1545     (description
1546      "This is the principal package in the AMS-LaTeX distribution.  It adapts
1547 for use in LaTeX most of the mathematical features found in AMS-TeX; it is
1548 highly recommended as an adjunct to serious mathematical typesetting in LaTeX.
1549 When amsmath is loaded, AMS-LaTeX packages @code{amsbsyamsbsy} (for bold
1550 symbols), @code{amsopnamsopn} (for operator names) and
1551 @code{amstextamstext} (for text embedded in mathematics) are also loaded.
1552 This package is part of the LaTeX required distribution; however, several
1553 contributed packages add still further to its appeal; examples are
1554 @code{empheqempheq}, which provides functions for decorating and highlighting
1555 mathematics, and @code{ntheoremntheorem}, for specifying theorem (and similar)
1556 definitions.")
1557     (license license:lppl1.3c+)))
1559 (define-public texlive-latex-amscls
1560   (package
1561     (name "texlive-latex-amscls")
1562     (version (number->string %texlive-revision))
1563     (source (origin
1564               (method svn-fetch)
1565               (uri (texlive-ref "latex" "amscls"))
1566               (file-name (string-append name "-" version "-checkout"))
1567               (sha256
1568                (base32
1569                 "0jmcr37mcdi7drczppvr6lmz5d5yd9m67ii79gp2nglg1xpw934j"))))
1570     (build-system texlive-build-system)
1571     (arguments
1572      `(#:tex-directory "latex/amscls"))
1573     (home-page "https://www.ctan.org/pkg/amscls")
1574     (synopsis "AMS document classes for LaTeX")
1575     (description
1576      "This bundle contains three AMS classes: @code{amsartamsart} (for writing
1577 articles for the AMS), @code{amsbookamsbook} (for books) and
1578 @code{amsprocamsproc} (for proceedings), together with some supporting
1579 material.  The material is made available as part of the AMS-LaTeX
1580 distribution.")
1581     (license license:lppl1.3c+)))
1583 (define-public texlive-latex-babel
1584   (package
1585     (name "texlive-latex-babel")
1586     (version (number->string %texlive-revision))
1587     (source (origin
1588               (method svn-fetch)
1589               (uri (texlive-ref "latex" "babel"))
1590               (file-name (string-append name "-" version "-checkout"))
1591               (sha256
1592                (base32
1593                 "1n3i5adsyy7jw0imnzrm2i8wkf73i3mjk9h3ic8cb9cd19i4r9r3"))))
1594     (build-system texlive-build-system)
1595     (arguments
1596      '(#:tex-directory "generic/babel"
1597        #:phases
1598        (modify-phases %standard-phases
1599          ;; This package tries to produce babel.aux twice but refuses to
1600          ;; overwrite the first one.
1601          (add-before 'build 'fix-ins
1602            (lambda _
1603              (substitute* "babel.ins"
1604                (("askonceonly") "askforoverwritefalse"))
1605              #t)))))
1606     (home-page "https://www.ctan.org/pkg/babel")
1607     (synopsis "Multilingual support for Plain TeX or LaTeX")
1608     (description
1609      "The package manages culturally-determined typographical (and other)
1610 rules, and hyphenation patterns for a wide range of languages.  A document may
1611 select a single language to be supported, or it may select several, in which
1612 case the document may switch from one language to another in a variety of
1613 ways.  Babel uses contributed configuration files that provide the detail of
1614 what has to be done for each language.  Users of XeTeX are advised to use the
1615 polyglossia package rather than Babel.")
1616     (license license:lppl1.3+)))
1618 (define-public texlive-generic-babel-english
1619   (package
1620     (name "texlive-generic-babel-english")
1621     (version (number->string %texlive-revision))
1622     (source (origin
1623               (method svn-fetch)
1624               (uri (texlive-ref "generic" "babel-english"))
1625               (file-name (string-append name "-" version "-checkout"))
1626               (sha256
1627                (base32
1628                 "1s404wbx91z5w65hm024kyl4h56zsa096irx18vsx8jvlmwsr5wc"))))
1629     (build-system texlive-build-system)
1630     (arguments '(#:tex-directory "generic/babel-english"))
1631     (home-page "https://www.ctan.org/pkg/babel-english")
1632     (synopsis "Babel support for English")
1633     (description
1634      "This package provides the language definition file for support of
1635 English in @code{babel}.  Care is taken to select British hyphenation patterns
1636 for British English and Australian text, and default (\"american\") patterns
1637 for Canadian and USA text.")
1638     (license license:lppl1.3+)))
1640 (define-public texlive-latex-cyrillic
1641   (package
1642     (name "texlive-latex-cyrillic")
1643     (version (number->string %texlive-revision))
1644     (source (origin
1645               (method svn-fetch)
1646               (uri (texlive-ref "latex" "cyrillic"))
1647               (file-name (string-append name "-" version "-checkout"))
1648               (sha256
1649                (base32
1650                 "1mdhl35hwas68ki56qqngzar37dwv4mm64l2canihr255bz34lbv"))))
1651     (build-system texlive-build-system)
1652     (arguments
1653      '(#:tex-directory "latex/cyrillic"))
1654     (home-page "https://www.ctan.org/pkg/latex-cyrillic")
1655     (synopsis "Support for Cyrillic fonts in LaTeX")
1656     (description
1657      "This bundle of macros files provides macro support (including font
1658 encoding macros) for the use of Cyrillic characters in fonts encoded under the
1659 T2* and X2 encodings. These encodings cover (between them) pretty much every
1660 language that is written in a Cyrillic alphabet.")
1661     (license license:lppl1.3c+)))
1663 (define-public texlive-latex-psnfss
1664   (package
1665     (name "texlive-latex-psnfss")
1666     (version (number->string %texlive-revision))
1667     (source (origin
1668               (method svn-fetch)
1669               (uri (texlive-ref "latex" "psnfss"))
1670               (file-name (string-append name "-" version "-checkout"))
1671               (sha256
1672                (base32
1673                 "1920dcq8613yzprasbg80fh4fcjcidvvl54wkx438nimyxcri7qz"))))
1674     (build-system texlive-build-system)
1675     (arguments '(#:tex-directory "latex/psnfss"))
1676     (home-page "https://www.ctan.org/pkg/psnfss")
1677     (synopsis "Font support for common PostScript fonts")
1678     (description
1679      "The PSNFSS collection includes a set of files that provide a complete
1680 working setup of the LaTeX font selection scheme (NFSS2) for use with common
1681 PostScript fonts.  It covers the so-called \"Base\" fonts (which are built
1682 into any Level 2 PostScript printing device and the Ghostscript interpreter)
1683 and a number of free fonts.  It provides font definition files, macros and
1684 font metrics.  The bundle as a whole is part of the LaTeX required set of
1685 packages.")
1686     (license license:lppl1.2+)))
1688 (define-public texlive-union
1689   (lambda* (#:optional (packages '()))
1690     "Return 'texlive-union' package which is a union of PACKAGES and the
1691 standard LaTeX packages."
1692     (let ((default-packages
1693             (list texlive-bin
1694                   texlive-dvips
1695                   texlive-fontname
1696                   texlive-fonts-cm
1697                   texlive-fonts-latex
1698                   texlive-metafont-base
1699                   texlive-latex-base
1700                   ;; LaTeX packages from the "required" set.
1701                   texlive-latex-amsmath
1702                   texlive-latex-amscls
1703                   texlive-latex-babel
1704                   texlive-generic-babel-english
1705                   texlive-latex-cyrillic
1706                   texlive-latex-graphics
1707                   texlive-latex-psnfss
1708                   texlive-latex-tools)))
1709       (package
1710         (name "texlive-union")
1711         (version (number->string %texlive-revision))
1712         (source #f)
1713         (build-system trivial-build-system)
1714         (arguments
1715          '(#:modules ((guix build union)
1716                       (guix build utils)
1717                       (guix build texlive-build-system)
1718                       (guix build gnu-build-system)
1719                       (guix build gremlin)
1720                       (guix elf))
1721            #:builder
1722            (begin
1723              (use-modules (ice-9 match)
1724                           (srfi srfi-26)
1725                           (guix build union)
1726                           (guix build utils)
1727                           (guix build texlive-build-system))
1728              (let* ((out       (assoc-ref %outputs "out"))
1729                     (texmf.cnf (string-append out "/share/texmf-dist/web2c/texmf.cnf")))
1730                ;; Build a modifiable union of all inputs (but exclude bash)
1731                (match (filter (match-lambda
1732                                 ((name . _)
1733                                  (not (string=? "bash" name))))
1734                               %build-inputs)
1735                  (((names . directories) ...)
1736                   (union-build (assoc-ref %outputs "out")
1737                                directories
1738                                #:create-all-directories? #t
1739                                #:log-port (%make-void-port "w"))))
1741                ;; The configuration file "texmf.cnf" is provided by the
1742                ;; "texlive-bin" package.  We take it and override only the
1743                ;; setting for TEXMFROOT and TEXMF.  This file won't be consulted
1744                ;; by default, though, so we still need to set TEXMFCNF.
1745                (substitute* texmf.cnf
1746                  (("^TEXMFROOT = .*")
1747                   (string-append "TEXMFROOT = " out "/share\n"))
1748                  (("^TEXMF = .*")
1749                   "TEXMF = $TEXMFROOT/share/texmf-dist\n"))
1750                (setenv "PATH" (string-append (assoc-ref %build-inputs "bash")
1751                                              "/bin"))
1752                (for-each
1753                 (cut wrap-program <>
1754                      `("TEXMFCNF" ":" = (,(dirname texmf.cnf)))
1755                      `("TEXMF"    ":" = (,(string-append out "/share/texmf-dist"))))
1756                 (find-files (string-append out "/bin") ".*"))
1757                #t))))
1758         (inputs
1759          `(("bash" ,bash)
1760            ,@(map (lambda (package)
1761                     (list (package-name package) package))
1762                   (append default-packages packages))))
1763         (home-page (package-home-page texlive-bin))
1764         (synopsis "Union of TeX Live packages")
1765         (description "This package provides a subset of the TeX Live
1766 distribution.")
1767         (license (fold (lambda (package result)
1768                          (match (package-license package)
1769                            ((lst ...)
1770                             (append lst result))
1771                            ((? license:license? license)
1772                             (cons license result))))
1773                        '()
1774                        (append default-packages packages)))))))
1776 (define-public texlive-tiny
1777   (package
1778     (inherit (texlive-union))
1779     (name "texlive-tiny")
1780     (description "This is a very limited subset of the TeX Live distribution.
1781 It includes little more than the required set of LaTeX packages.")))
1783 (define-public texlive-latex-amsrefs
1784   (package
1785     (name "texlive-latex-amsrefs")
1786     (version (number->string %texlive-revision))
1787     (source (origin
1788               (method svn-fetch)
1789               (uri (texlive-ref "latex" "amsrefs"))
1790               (file-name (string-append name "-" version "-checkout"))
1791               (sha256
1792                (base32
1793                 "15i4k479dwrpr0kspmm70g1yn4p3dkh0whyzmr93hph9bggnh1i1"))))
1794     (build-system texlive-build-system)
1795     (arguments '(#:tex-directory "latex/amsrefs"))
1796     (home-page "https://www.ctan.org/pkg/amsrefs")
1797     (synopsis "LaTeX-based replacement for BibTeX")
1798     (description
1799      "Amsrefs is a LaTeX package for bibliographies that provides an archival
1800 data format similar to the format of BibTeX database files, but adapted to
1801 make direct processing by LaTeX easier.  The package can be used either in
1802 conjunction with BibTeX or as a replacement for BibTeX.")
1803     (license license:lppl1.3+)))
1805 (define-public texlive-latex-bigfoot
1806   (package
1807     (name "texlive-latex-bigfoot")
1808     (version (number->string %texlive-revision))
1809     (source (origin
1810               (method svn-fetch)
1811               (uri (texlive-ref "latex" "bigfoot"))
1812               (file-name (string-append name "-" version "-checkout"))
1813               (sha256
1814                (base32
1815                 "092g8alnsdwlgl1isdnqrr32l161994295kadr1n05d81xgj5wnv"))))
1816     (build-system texlive-build-system)
1817     (arguments
1818      '(#:tex-directory "latex/bigfoot"
1819        #:phases
1820        (modify-phases %standard-phases
1821          (add-after 'unpack 'remove-generated-file
1822            (lambda _
1823              (for-each delete-file (find-files "." "\\.drv$"))
1824              #t)))))
1825     (home-page "https://www.ctan.org/pkg/bigfoot")
1826     (synopsis "Footnotes for critical editions")
1827     (description
1828      "This package aims to provide a one-stop solution to requirements for
1829 footnotes.  It offers: Multiple footnote apparatus superior to that of
1830 @code{manyfoot}.  Footnotes can be formatted in separate paragraphs, or be run
1831 into a single paragraph (this choice may be selected per footnote series);
1832 Things you might have expected (such as @code{\\verb}-like material in
1833 footnotes, and color selections over page breaks) now work.  Note that the
1834 majority of the bigfoot package's interface is identical to that of
1835 @code{manyfoot}; users should seek information from that package's
1836 documentation.  The bigfoot bundle also provides the @code{perpage} and
1837 @code{suffix} packages.")
1838     (license license:gpl2+)))
1840 (define-public texlive-latex-blindtext
1841   (package
1842     (name "texlive-latex-blindtext")
1843     (version (number->string %texlive-revision))
1844     (source (origin
1845               (method svn-fetch)
1846               (uri (texlive-ref "latex" "blindtext"))
1847               (file-name (string-append name "-" version "-checkout"))
1848               (sha256
1849                (base32
1850                 "1jrja9b1pzdh9zgv1jh807w4xijqja58n2mqny6dkwicv8qfgbfg"))))
1851     (build-system texlive-build-system)
1852     (arguments '(#:tex-directory "latex/blindtext"))
1853     (home-page "https://www.ctan.org/pkg/blindtext")
1854     (synopsis "Producing 'blind' text for testing")
1855     (description
1856      "The package provides the commands @code{\\blindtext} and
1857 @code{\\Blindtext} for creating \"blind\" text useful in testing new classes
1858 and packages, and @code{\\blinddocument}, @code{\\Blinddocument} for creating
1859 an entire random document with sections, lists, mathematics, etc.  The package
1860 supports three languages, @code{english}, @code{(n)german} and @code{latin};
1861 the @code{latin} option provides a short \"lorem ipsum\" (for a fuller \"lorem
1862 ipsum\" text, see the @code{lipsum} package).")
1863     (license license:lppl)))
1865 (define-public texlive-latex-dinbrief
1866   (package
1867     (name "texlive-latex-dinbrief")
1868     (version (number->string %texlive-revision))
1869     (source (origin
1870               (method svn-fetch)
1871               (uri (texlive-ref "latex" "dinbrief"))
1872               (file-name (string-append name "-" version "-checkout"))
1873               (sha256
1874                (base32
1875                 "0lb0kiy8fxzl6cnhcw1sggy6jrjvcd6kj1kkw3k9lkimm388yjz6"))))
1876     (build-system texlive-build-system)
1877     (arguments
1878      '(#:tex-directory "latex/dinbrief"
1879        #:phases
1880        (modify-phases %standard-phases
1881          (add-after 'unpack 'remove-generated-file
1882            (lambda _
1883              (delete-file "dinbrief.drv")
1884              #t)))))
1885     (home-page "https://www.ctan.org/pkg/dinbrief")
1886     (synopsis "German letter DIN style")
1887     (description
1888      "This package implements a document layout for writing letters according
1889 to the rules of DIN (Deutsches Institut für Normung, German standardisation
1890 institute).  A style file for LaTeX 2.09 (with limited support of the
1891 features) is part of the package.  Since the letter layout is based on a
1892 German standard, the user guide is written in German, but most macros have
1893 English names from which the user can recognize what they are used for.  In
1894 addition there are example files showing how letters may be created with the
1895 package.")
1896     (license license:lppl)))
1898 (define-public texlive-latex-draftwatermark
1899   (package
1900     (name "texlive-latex-draftwatermark")
1901     (version (number->string %texlive-revision))
1902     (source (origin
1903               (method svn-fetch)
1904               (uri (texlive-ref "latex" "draftwatermark"))
1905               (file-name (string-append name "-" version "-checkout"))
1906               (sha256
1907                (base32
1908                 "1zyl2pcz2x529gzj5m93a1s4ipymdabf7qdjl3l1673pizd4hfyv"))))
1909     (build-system texlive-build-system)
1910     (arguments '(#:tex-directory "latex/draftwatermark"))
1911     (home-page "https://www.ctan.org/pkg/draftwatermark")
1912     (synopsis "Put a grey textual watermark on document pages")
1913     (description
1914      "This package provides a means to add a textual, light grey watermark on
1915 every page or on the first page of a document.  Typical usage may consist in
1916 writing words such as DRAFT or CONFIDENTIAL across document pages.  The
1917 package performs a similar function to that of @code{draftcopy}, but its
1918 implementation is output device independent, and made very simple by relying
1919 on everypage.")
1920     (license license:lppl1.3+)))
1922 (define-public texlive-latex-environ
1923   (package
1924     (name "texlive-latex-environ")
1925     (version (number->string %texlive-revision))
1926     (source (origin
1927               (method svn-fetch)
1928               (uri (texlive-ref "latex" "environ"))
1929               (file-name (string-append name "-" version "-checkout"))
1930               (sha256
1931                (base32
1932                 "06h28b26dyjkj9shksphgqfv4130jfkwhbw737hxn7d3yvdfffyd"))))
1933     (build-system texlive-build-system)
1934     (arguments '(#:tex-directory "latex/environ"))
1935     (home-page "https://www.ctan.org/pkg/environ")
1936     (synopsis "New interface for environments in LaTeX")
1937     (description
1938      "This package provides the @code{\\collect@@body} command (as in
1939 @code{amsmath}), as well as a @code{\\long} version @code{\\Collect@@Body},
1940 for collecting the body text of an environment.  These commands are used to
1941 define a new author interface to creating new environments.")
1942     (license license:lppl)))
1944 (define-public texlive-latex-eqparbox
1945   (package
1946     (name "texlive-latex-eqparbox")
1947     (version (number->string %texlive-revision))
1948     (source (origin
1949               (method svn-fetch)
1950               (uri (texlive-ref "latex" "eqparbox"))
1951               (file-name (string-append name "-" version "-checkout"))
1952               (sha256
1953                (base32
1954                 "0pvmhsd4xmpil0m3c7qcgwilbk266mlkzv03g0jr8r3zd8jxlyzq"))))
1955     (build-system texlive-build-system)
1956     (arguments '(#:tex-directory "latex/eqparbox"))
1957     (home-page "https://www.ctan.org/pkg/eqparbox")
1958     (synopsis "Create equal-widthed parboxes")
1959     (description
1960      "LaTeX users sometimes need to ensure that two or more blocks of text
1961 occupy the same amount of horizontal space on the page.  To that end, the
1962 @code{eqparbox} package defines a new command, @code{\\eqparbox}, which works
1963 just like @code{\\parbox}, except that instead of specifying a width, one
1964 specifies a tag.  All @code{eqparbox}es with the same tag---regardless of
1965 where they are in the document---will stretch to fit the widest
1966 @code{eqparbox} with that tag.  This simple, equal-width mechanism can be used
1967 for a variety of alignment purposes, as is evidenced by the examples in
1968 @code{eqparbox}'s documentation.  Various derivatives of @code{\\eqparbox} are
1969 also provided.")
1970     (license license:lppl1.3+)))
1972 (define-public texlive-latex-expdlist
1973   (package
1974     (name "texlive-latex-expdlist")
1975     (version (number->string %texlive-revision))
1976     (source (origin
1977               (method svn-fetch)
1978               (uri (texlive-ref "latex" "expdlist"))
1979               (file-name (string-append name "-" version "-checkout"))
1980               (sha256
1981                (base32
1982                 "1x7byk6x10njir3y9rm56glhdzrxwqag7gsnw2sqn1czlq525w7r"))))
1983     (build-system texlive-build-system)
1984     (arguments
1985      '(#:tex-directory "latex/expdlist"
1986        #:phases
1987        (modify-phases %standard-phases
1988          (add-after 'unpack 'remove-generated-file
1989            (lambda _
1990              (for-each delete-file
1991                        (find-files "." "\\.drv$"))
1992              #t)))))
1993     (home-page "https://www.ctan.org/pkg/expdlist")
1994     (synopsis "Expanded description environments")
1995     (description
1996      "The package provides additional features for the LaTeX
1997 @code{description} environment, including adjustable left margin.  The package
1998 also allows the user to \"break\" a list (for example, to interpose a comment)
1999 without affecting the structure of the list (this works for @code{itemize} and
2000 @code{enumerate} lists, and numbered lists remain in sequence).")
2001     (license license:lppl)))
2003 (define-public texlive-latex-filemod
2004   (package
2005     (name "texlive-latex-filemod")
2006     (version (number->string %texlive-revision))
2007     (source (origin
2008               (method svn-fetch)
2009               (uri (svn-reference
2010                     (url (string-append "svn://www.tug.org/texlive/tags/"
2011                                         %texlive-tag "/Master/texmf-dist/"
2012                                         "/tex/latex/filemod"))
2013                     (revision %texlive-revision)))
2014               (file-name (string-append name "-" version "-checkout"))
2015               (sha256
2016                (base32
2017                 "0vpxilfw69xv78f03g0j0zw0bw4qcn36whqp8phcq48qk1ax2kr2"))))
2018     (build-system trivial-build-system)
2019     (arguments
2020      `(#:modules ((guix build utils))
2021        #:builder
2022        (begin
2023          (use-modules (guix build utils))
2024          (let ((target (string-append (assoc-ref %outputs "out")
2025                                       "/share/texmf-dist/tex/latex/filemod")))
2026            (mkdir-p target)
2027            (copy-recursively (assoc-ref %build-inputs "source") target)
2028            #t))))
2029     (home-page "https://www.ctan.org/pkg/filemod")
2030     (synopsis "Provide file modification times, and compare them")
2031     (description
2032      "This package provides macros to read and compare the modification dates
2033 of files.  The files may be @code{.tex} files, images or other files (as long
2034 as they can be found by LaTeX).  It uses the @code{\\pdffilemoddate} primitive
2035 of pdfLaTeX to find the file modification date as PDF date string, parses the
2036 string and returns the value to the user.  The package will also work for DVI
2037 output with recent versions of the LaTeX compiler which uses pdfLaTeX in DVI
2038 mode.  The functionality is provided by purely expandable macros or by faster
2039 but non-expandable ones.")
2040     (license license:lppl1.3+)))
2042 (define-public texlive-latex-ifplatform
2043   (package
2044     (name "texlive-latex-ifplatform")
2045     (version (number->string %texlive-revision))
2046     (source (origin
2047               (method svn-fetch)
2048               (uri (texlive-ref "latex" "ifplatform"))
2049               (file-name (string-append name "-" version "-checkout"))
2050               (sha256
2051                (base32
2052                 "11gvvjvmdfs9b7mm19yf80zwkx49jqcbq6g8qb9y5ns1r1qvnixp"))))
2053     (build-system texlive-build-system)
2054     (arguments '(#:tex-directory "latex/ifplatform"))
2055     (home-page "https://www.ctan.org/pkg/ifplatform")
2056     (synopsis "Conditionals to test which platform is being used")
2057     (description
2058      "This package uses the (La)TeX extension @code{-shell-escape} to
2059 establish whether the document is being processed on a Windows or on a
2060 Unix-like system, or on Cygwin (Unix environment over a Windows system).
2061 Booleans provided are: @code{\\ifwindows}, @code{\\iflinux}, @code{\\ifmacosx}
2062 and @code{\\ifcygwin}.  The package also preserves the output of @code{uname}
2063 on a Unix-like system, which may be used to distinguish between various
2064 classes of systems.")
2065     (license license:lppl)))
2067 (define-public texlive-latex-natbib
2068   (package
2069     (name "texlive-latex-natbib")
2070     (version (number->string %texlive-revision))
2071     (source (origin
2072               (method svn-fetch)
2073               (uri (texlive-ref "latex" "natbib"))
2074               (file-name (string-append name "-" version "-checkout"))
2075               (sha256
2076                (base32
2077                 "0aqliq0nwblxyrzhwhv77pnmk7qh2y3prgq7z7qhwcbgz5kisld7"))))
2078     (build-system texlive-build-system)
2079     (arguments '(#:tex-directory "latex/natbib"))
2080     (home-page "https://www.ctan.org/pkg/natbib")
2081     (synopsis "Flexible bibliography support")
2082     (description
2083      "This bundle provides a package that implements both author-year and
2084 numbered references, as well as much detailed of support for other
2085 bibliography use.  Also provided are versions of the standard BibTeX styles
2086 that are compatible with @code{natbib}: @code{plainnat}, @code{unsrtnat},
2087 @code{abbrnat}.  The bibliography styles produced by @code{custom-bib} are
2088 designed from the start to be compatible with @code{natbib}.")
2089     (license license:lppl)))
2091 (define-public texlive-latex-psfrag
2092   (package
2093     (name "texlive-latex-psfrag")
2094     (version (number->string %texlive-revision))
2095     (source (origin
2096               (method svn-fetch)
2097               (uri (texlive-ref "latex" "psfrag"))
2098               (file-name (string-append name "-" version "-checkout"))
2099               (sha256
2100                (base32
2101                 "1dxbl5il7wbbsp0v45vk884xi1192wxw03849pb1g5q4x808n352"))))
2102     (build-system texlive-build-system)
2103     (arguments '(#:tex-directory "latex/psfrag"))
2104     (home-page "https://www.ctan.org/pkg/psfrag")
2105     (synopsis "Replace strings in encapsulated PostScript figures")
2106     (description
2107      "This package allows LaTeX constructions (equations, picture
2108 environments, etc.) to be precisely superimposed over Encapsulated PostScript
2109 figures, using your own favorite drawing tool to create an EPS figure and
2110 placing simple text \"tags\" where each replacement is to be placed, with
2111 PSfrag automatically removing these tags from the figure and replacing them
2112 with a user specified LaTeX construction, properly aligned, scaled, and/or
2113 rotated.")
2114     (license (license:fsf-free "file://psfrag.dtx"))))
2116 (define-public texlive-latex-pstool
2117   (package
2118     (name "texlive-latex-pstool")
2119     (version (number->string %texlive-revision))
2120     (source (origin
2121               (method svn-fetch)
2122               (uri (texlive-ref "latex" "pstool"))
2123               (file-name (string-append name "-" version "-checkout"))
2124               (sha256
2125                (base32
2126                 "1kwlk1x67lad4xb7gpkxqgdlxwpi6nvq1r9wika7m92abmyf18h3"))))
2127     (build-system texlive-build-system)
2128     (arguments
2129      '(#:tex-directory "latex/pstool"
2130        #:tex-format "latex"))
2131     (inputs
2132      `(("texlive-fonts-cm" ,texlive-fonts-cm)
2133        ("texlive-latex-filecontents" ,texlive-latex-filecontents)))
2134     (propagated-inputs
2135      `(("texlive-latex-bigfoot" ,texlive-latex-bigfoot)
2136        ("texlive-latex-filemod" ,texlive-latex-filemod)
2137        ("texlive-latex-graphics" ,texlive-latex-graphics)
2138        ("texlive-latex-ifplatform" ,texlive-latex-ifplatform)
2139        ("texlive-latex-oberdiek" ,texlive-latex-oberdiek)
2140        ("texlive-latex-psfrag" ,texlive-latex-psfrag)
2141        ("texlive-latex-trimspaces" ,texlive-latex-trimspaces)))
2142     (home-page "https://www.ctan.org/pkg/pstool")
2143     (synopsis "Process PostScript graphisc within pdfLaTeX documents")
2144     (description
2145      "This is a package for processing PostScript graphics with @code{psfrag}
2146 labels within pdfLaTeX documents.  Every graphic is compiled individually,
2147 drastically speeding up compilation time when only a single figure needs
2148 re-processing.")
2149     (license license:lppl)))
2151 (define-public texlive-latex-seminar
2152   (package
2153     (name "texlive-latex-seminar")
2154     (version (number->string %texlive-revision))
2155     (source (origin
2156               (method svn-fetch)
2157               (uri (svn-reference
2158                     (url (string-append "svn://www.tug.org/texlive/tags/"
2159                                         %texlive-tag "/Master/texmf-dist/"
2160                                         "/tex/latex/seminar"))
2161                     (revision %texlive-revision)))
2162               (file-name (string-append name "-" version "-checkout"))
2163               (sha256
2164                (base32
2165                 "0y4i651b75y6006n03x8n86bsqvjsailvvz9bhzy51dzsznqidq0"))))
2166     (build-system texlive-build-system)
2167     (arguments '(#:tex-directory "latex/seminar"))
2168     (home-page "https://www.ctan.org/pkg/seminar")
2169     (synopsis "Make overhead slides")
2170     ;; TODO: This package may need fancybox and xcomment at runtime.
2171     (description
2172      "This package provides a class that produces overhead
2173 slides (transparencies), with many facilities.  Seminar is not nowadays
2174 reckoned a good basis for a presentation — users are advised to use more
2175 recent classes such as powerdot or beamer, both of which are tuned to
2176 21st-century presentation styles.")
2177     (license license:lppl1.2+)))
2179 (define-public texlive-latex-trimspaces
2180   (package
2181     (name "texlive-latex-trimspaces")
2182     (version (number->string %texlive-revision))
2183     (source (origin
2184               (method svn-fetch)
2185               (uri (texlive-ref "latex" "trimspaces"))
2186               (file-name (string-append name "-" version "-checkout"))
2187               (sha256
2188                (base32
2189                 "0da00lb32am4g63mn96625wg48p3pj3spx79lajrk17d549apwqa"))))
2190     (build-system texlive-build-system)
2191     (arguments
2192      '(#:tex-directory "latex/trimspaces"
2193        #:tex-format "latex"
2194        #:phases
2195        (modify-phases %standard-phases
2196          (add-after 'unpack 'fix-bug
2197            (lambda _
2198              ;; The "ins" file refers to the wrong source file.
2199              (substitute* "trimspaces.ins"
2200                (("pstool.tex") "trimspaces.tex"))
2201              #t)))))
2202     (inputs
2203      `(("texlive-latex-filecontents" ,texlive-latex-filecontents)))
2204     (home-page "https://www.ctan.org/pkg/trimspaces")
2205     (synopsis "Trim spaces around an argument or within a macro")
2206     (description
2207      "This very short package allows you to expandably remove spaces around a
2208 token list (commands are provided to remove spaces before, spaces after, or
2209 both); or to remove surrounding spaces within a macro definition, or to define
2210 space-stripped macros.")
2211     (license license:lppl)))
2213 (define-public texlive-latex-capt-of
2214   (package
2215     (name "texlive-latex-capt-of")
2216     (version (number->string %texlive-revision))
2217     (source (origin
2218               (method svn-fetch)
2219               (uri (svn-reference
2220                     (url (string-append "svn://www.tug.org/texlive/tags/"
2221                                         %texlive-tag "/Master/texmf-dist/"
2222                                         "/tex/latex/capt-of"))
2223                     (revision %texlive-revision)))
2224               (file-name (string-append name "-" version "-checkout"))
2225               (sha256
2226                (base32
2227                 "1y2s50f6lz0jx2748lj3iy56hrpcczgnbzmvphxv7aqndyyamd4x"))))
2228     (build-system trivial-build-system)
2229     (arguments
2230      `(#:modules ((guix build utils))
2231        #:builder
2232        (begin
2233          (use-modules (guix build utils))
2234          (let ((target (string-append (assoc-ref %outputs "out")
2235                                       "/share/texmf-dist/tex/latex/capt-of")))
2236            (mkdir-p target)
2237            (copy-recursively (assoc-ref %build-inputs "source") target)
2238            #t))))
2239     (home-page "https://www.ctan.org/pkg/capt-of")
2240     (synopsis "Captions on more than floats")
2241     (description
2242      "This package defines a command @code{\\captionof} for putting a caption
2243 to something that's not a float.")
2244     (license license:lppl)))
2246 (define-public texlive-latex-etoolbox
2247   (package
2248     (name "texlive-latex-etoolbox")
2249     (version (number->string %texlive-revision))
2250     (source (origin
2251               (method svn-fetch)
2252               (uri (svn-reference
2253                     (url (string-append "svn://www.tug.org/texlive/tags/"
2254                                         %texlive-tag "/Master/texmf-dist/"
2255                                         "/tex/latex/etoolbox"))
2256                     (revision %texlive-revision)))
2257               (file-name (string-append name "-" version "-checkout"))
2258               (sha256
2259                (base32
2260                 "0016bscnpima9krrg2569mva78xzwnygzlvg87dznsm6gf8g589v"))))
2261     (build-system trivial-build-system)
2262     (arguments
2263      `(#:modules ((guix build utils))
2264        #:builder
2265        (begin
2266          (use-modules (guix build utils))
2267          (let ((target (string-append (assoc-ref %outputs "out")
2268                                       "/share/texmf-dist/tex/latex/etoolbox")))
2269            (mkdir-p target)
2270            (copy-recursively (assoc-ref %build-inputs "source") target)
2271            #t))))
2272     (home-page "https://www.ctan.org/pkg/etoolbox")
2273     (synopsis "e-TeX tools for LaTeX")
2274     (description
2275      "This package is a toolbox of programming facilities geared primarily
2276 towards LaTeX class and package authors.  It provides LaTeX frontends to some
2277 of the new primitives provided by e-TeX as well as some generic tools which
2278 are not strictly related to e-TeX but match the profile of this package.  The
2279 package provides functions that seem to offer alternative ways of implementing
2280 some LaTeX kernel commands; nevertheless, the package will not modify any part
2281 of the LaTeX kernel.")
2282     (license license:lppl1.3+)))
2284 (define-public texlive-latex-fncychap
2285   (package
2286     (name "texlive-latex-fncychap")
2287     (version (number->string %texlive-revision))
2288     (source (origin
2289               (method svn-fetch)
2290               (uri (svn-reference
2291                     (url (string-append "svn://www.tug.org/texlive/tags/"
2292                                         %texlive-tag "/Master/texmf-dist/"
2293                                         "/tex/latex/fncychap"))
2294                     (revision %texlive-revision)))
2295               (file-name (string-append name "-" version "-checkout"))
2296               (sha256
2297                (base32
2298                 "0fdk84dbicfjfprkz6vk15x36mvlhaw9isjmgkc56jp2khwjswwq"))))
2299     (build-system trivial-build-system)
2300     (arguments
2301      `(#:modules ((guix build utils))
2302        #:builder
2303        (begin
2304          (use-modules (guix build utils))
2305          (let ((target (string-append (assoc-ref %outputs "out")
2306                                       "/share/texmf-dist/tex/latex/fncychap")))
2307            (mkdir-p target)
2308            (copy-recursively (assoc-ref %build-inputs "source") target)
2309            #t))))
2310     (home-page "https://www.ctan.org/pkg/fncychap")
2311     (synopsis "Seven predefined chapter heading styles")
2312     (description
2313      "This package provides seven predefined chapter heading styles.  Each
2314 style can be modified using a set of simple commands.  Optionally one can
2315 modify the formatting routines in order to create additional chapter
2316 headings.")
2317     (license license:lppl1.3+)))
2319 (define-public texlive-latex-framed
2320   (package
2321     (name "texlive-latex-framed")
2322     (version (number->string %texlive-revision))
2323     (source (origin
2324               (method svn-fetch)
2325               (uri (svn-reference
2326                     (url (string-append "svn://www.tug.org/texlive/tags/"
2327                                         %texlive-tag "/Master/texmf-dist/"
2328                                         "/tex/latex/framed"))
2329                     (revision %texlive-revision)))
2330               (file-name (string-append name "-" version "-checkout"))
2331               (sha256
2332                (base32
2333                 "14a4ydqsvp3vcfavl21jrv0ybiqypaaqzg2q2cs3rzkandg7w98x"))))
2334     (build-system trivial-build-system)
2335     (arguments
2336      `(#:modules ((guix build utils))
2337        #:builder
2338        (begin
2339          (use-modules (guix build utils))
2340          (let ((target (string-append (assoc-ref %outputs "out")
2341                                       "/share/texmf-dist/tex/latex/framed")))
2342            (mkdir-p target)
2343            (copy-recursively (assoc-ref %build-inputs "source") target)
2344            #t))))
2345     (home-page "https://www.ctan.org/pkg/framed")
2346     (synopsis "Framed or shaded regions that can break across pages")
2347     (description
2348      "The package creates three environments: @code{framed}, which puts an
2349 ordinary frame box around the region, @code{shaded}, which shades the region,
2350 and @code{leftbar}, which places a line at the left side.  The environments
2351 allow a break at their start (the @code{\\FrameCommand} enables creation of a
2352 title that is “attached” to the environment); breaks are also allowed in the
2353 course of the framed/shaded matter.  There is also a command
2354 @code{\\MakeFramed} to make your own framed-style environments.")
2355     ;; The header states: "These macros may be freely transmitted, reproduced,
2356     ;; or modified for any purpose provided that this notice is left intact."
2357     (license (license:fsf-free "file://framed.sty"))))
2359 (define-public texlive-latex-g-brief
2360   (package
2361     (name "texlive-latex-g-brief")
2362     (version (number->string %texlive-revision))
2363     (source (origin
2364               (method svn-fetch)
2365               (uri (texlive-ref "latex" "g-brief"))
2366               (file-name (string-append name "-" version "-checkout"))
2367               (sha256
2368                (base32
2369                 "0sikazkg0dpkcpzlbqw8qzxr81paf2f443vsrh14jnw7s4gswvc5"))))
2370     (build-system texlive-build-system)
2371     (arguments
2372      '(#:tex-directory "latex/g-brief"
2373        #:phases
2374        (modify-phases %standard-phases
2375          (add-after 'unpack 'remove-generated-file
2376            (lambda _
2377              (delete-file "g-brief.drv")
2378              #t)))))
2379     (home-page "https://www.ctan.org/pkg/g-brief")
2380     (synopsis "Letter document class")
2381     (description
2382      "This package is designed for formatting formless letters in German; it
2383 can also be used for English (by those who can read the documentation).  There
2384 are LaTeX 2.09 @code{documentstyle} and LaTeX 2e class files for both an
2385 \"old\" and a \"new\" version of g-brief.")
2386     (license license:lppl)))
2388 (define-public texlive-latex-galois
2389   (package
2390     (name "texlive-latex-galois")
2391     (version (number->string %texlive-revision))
2392     (source (origin
2393               (method svn-fetch)
2394               (uri (texlive-ref "latex" "galois"))
2395               (file-name (string-append name "-" version "-checkout"))
2396               (sha256
2397                (base32
2398                 "0d4l0msk8j5pi95xnmm9wygv1vbpkwkv5amx9l0km86cs79jpp1h"))))
2399     (build-system texlive-build-system)
2400     (arguments '(#:tex-directory "latex/galois"))
2401     (home-page "https://www.ctan.org/pkg/galois")
2402     (synopsis "Typeset Galois connections")
2403     (description
2404      "The package deals with connections in two-dimensional style, optionally
2405 in colour.")
2406     (license license:lppl)))
2408 (define-public texlive-latex-gcite
2409   (package
2410     (name "texlive-latex-gcite")
2411     (version (number->string %texlive-revision))
2412     (source (origin
2413               (method svn-fetch)
2414               (uri (texlive-ref "latex" "gcite"))
2415               (file-name (string-append name "-" version "-checkout"))
2416               (sha256
2417                (base32
2418                 "03g9by54yrypn599y98r1xh7qw0bbbmpzq0bfwpj6j5q5rkl1mfa"))))
2419     (build-system texlive-build-system)
2420     (arguments '(#:tex-directory "latex/gcite"))
2421     (home-page "https://www.ctan.org/pkg/gcite")
2422     (synopsis "Citations in a reader-friendly style")
2423     (description
2424      "The package allows citations in the German style, which is considered by
2425 many to be particularly reader-friendly.  The citation provides a small amount
2426 of bibliographic information in a footnote on the page where each citation is
2427 made.  It combines a desire to eliminate unnecessary page-turning with the
2428 look-up efficiency afforded by numeric citations.  The package makes use of
2429 BibLaTeX, and is considered experimental.")
2430     (license license:lppl1.3+)))
2432 (define-public texlive-latex-geometry
2433   (package
2434     (name "texlive-latex-geometry")
2435     (version (number->string %texlive-revision))
2436     (source (origin
2437               (method svn-fetch)
2438               (uri (texlive-ref "latex" "geometry"))
2439               (file-name (string-append name "-" version "-checkout"))
2440               (sha256
2441                (base32
2442                 "1r2kfcwclg33yk5z8mvlagwxj7nr1mc3w4bdpmhrwv6dn8mrbvw8"))))
2443     (build-system texlive-build-system)
2444     (arguments '(#:tex-directory "latex/geometry"))
2445     (home-page "https://www.ctan.org/pkg/geometry")
2446     (synopsis "Flexible and complete interface to document dimensions")
2447     (description
2448      "This package provides an easy and flexible user interface to customize
2449 page layout, implementing auto-centering and auto-balancing mechanisms so that
2450 the users have only to give the least description for the page layout.  The
2451 package knows about all the standard paper sizes, so that the user need not
2452 know what the nominal \"real\" dimensions of the paper are, just its standard
2453 name (such as a4, letter, etc.).  An important feature is the package's
2454 ability to communicate the paper size it's set up to the output.")
2455     (license license:lppl)))
2457 (define-public texlive-latex-mdwtools
2458   (package
2459     (name "texlive-latex-mdwtools")
2460     (version (number->string %texlive-revision))
2461     (source (origin
2462               (method svn-fetch)
2463               (uri (texlive-ref "latex" "mdwtools"))
2464               (file-name (string-append name "-" version "-checkout"))
2465               (sha256
2466                (base32
2467                 "0caxs74hla28hc67csf5i5ahadx97w8vxh3mdmsprxbpd1mr7ssg"))))
2468     (build-system texlive-build-system)
2469     (arguments '(#:tex-directory "latex/mdwtools"))
2470     (home-page "https://www.ctan.org/pkg/mdwtools")
2471     (synopsis "Miscellaneous tools by Mark Wooding")
2472     (description
2473      "This collection of tools includes: @code{atsupport} for short commands
2474 starting with @code{@@}, macros to sanitize the OT1 encoding of the
2475 @code{cmtt} fonts; a @code{doafter} command; improved @code{footnote} support;
2476 @code{mathenv} for various alignment in maths; list handling; @code{mdwmath}
2477 which adds some minor changes to LaTeX maths; a rewrite of LaTeX's tabular and
2478 array environments; verbatim handling; and syntax diagrams.")
2479     (license license:gpl3+)))
2481 (define-public texlive-latex-polyglossia
2482   (package
2483     (name "texlive-latex-polyglossia")
2484     (version (number->string %texlive-revision))
2485     (source (origin
2486               (method svn-fetch)
2487               (uri (texlive-ref "latex" "polyglossia"))
2488               (file-name (string-append name "-" version "-checkout"))
2489               (sha256
2490                (base32
2491                 "09mvszd5qgqg4cfglpj5qxyzjz190ppb9p8gnsnjydwp1akvhayf"))))
2492     (build-system texlive-build-system)
2493     (arguments '(#:tex-directory "latex/polyglossia"))
2494     (home-page "https://www.ctan.org/pkg/polyglossia")
2495     (synopsis "Alternative to babel for XeLaTeX and LuaLaTeX")
2496     (description
2497      "This package provides a complete Babel replacement for users of LuaLaTeX
2498 and XeLaTeX; it relies on the @code{fontspec} package, version 2.0 at least.")
2499     (license license:lppl1.3+)))
2501 (define-public texlive-latex-supertabular
2502   (package
2503     (name "texlive-latex-supertabular")
2504     (version (number->string %texlive-revision))
2505     (source (origin
2506               (method svn-fetch)
2507               (uri (texlive-ref "latex" "supertabular"))
2508               (file-name (string-append name "-" version "-checkout"))
2509               (sha256
2510                (base32
2511                 "14b2bc7cqz4ckxxycim9sw6jkrr1pahivm1rdbpz5k6hl967w1s3"))))
2512     (build-system texlive-build-system)
2513     (arguments '(#:tex-directory "latex/supertabular"))
2514     (home-page "https://www.ctan.org/pkg/supertabular")
2515     (synopsis "Multi-page tables package")
2516     (description
2517      "This package was a predecessor of @code{longtable}; the newer
2518 package (designed on quite different principles) is easier to use and more
2519 flexible, in many cases, but supertabular retains its usefulness in a few
2520 situations where longtable has problems.")
2521     (license license:lppl1.3+)))
2523 (define-public texlive-tex-texinfo
2524   (package
2525     (name "texlive-tex-texinfo")
2526     (version (number->string %texlive-revision))
2527     (source (origin
2528               (method svn-fetch)
2529               (uri (svn-reference
2530                     (url (string-append "svn://www.tug.org/texlive/tags/"
2531                                         %texlive-tag "/Master/texmf-dist/"
2532                                         "/tex/texinfo"))
2533                     (revision %texlive-revision)))
2534               (file-name (string-append name "-" version "-checkout"))
2535               (sha256
2536                (base32
2537                 "09zj2w3lx0y6i2syfjjgizahf86z301dw8p37ln6syfhqhzqdz46"))))
2538     (build-system trivial-build-system)
2539     (arguments
2540      `(#:modules ((guix build utils))
2541        #:builder
2542        (begin
2543          (use-modules (guix build utils))
2544          (let ((target (string-append (assoc-ref %outputs "out")
2545                                       "/share/texmf-dist/tex/texinfo")))
2546            (mkdir-p target)
2547            (copy-recursively (assoc-ref %build-inputs "source") target)
2548            #t))))
2549     (home-page "https://www.ctan.org/pkg/texinfo")
2550     (synopsis "TeX macros to handle Texinfo files")
2551     (description
2552      "Texinfo is the preferred format for documentation in the GNU project;
2553 the format may be used to produce online or printed output from a single
2554 source.  The Texinfo macros may be used to produce printable output using TeX;
2555 other programs in the distribution offer online interactive use (with
2556 hypertext linkages in some cases).")
2557     (license license:gpl3+)))
2559 (define-public texlive-latex-upquote
2560   (package
2561     (name "texlive-latex-upquote")
2562     (version (number->string %texlive-revision))
2563     (source (origin
2564               (method svn-fetch)
2565               (uri (texlive-ref "latex" "upquote"))
2566               (file-name (string-append name "-" version "-checkout"))
2567               (sha256
2568                (base32
2569                 "0d1050i973wnxigy0xpky5l7vn4ff7ldhkjpdqsw5s653gagwixp"))))
2570     (build-system texlive-build-system)
2571     (arguments '(#:tex-directory "latex/upquote"))
2572     (home-page "https://www.ctan.org/pkg/upquote")
2573     (synopsis "Show \"realistic\" quotes in verbatim")
2574     (description
2575      "Typewriter-style fonts are best for program listings, but Computer
2576 Modern Typewriter prints @code{`} and @code{'} as bent opening and closing
2577 single quotes.  Other fonts, and most programming languages, print @code{`} as
2578 a grave accent and @code{'} upright; @code{'} is used both to open and to
2579 close quoted strings.  The package switches the typewriter font to Computer
2580 Modern Typewriter in OT1 encoding, and modifies the behaviour of
2581 @code{verbatim}, @code{verbatim*}, @code{\\verb}, and @code{\\verb*} to print
2582 in the expected way.  It does this regardless of other fonts or encodings in
2583 use, so long as the package is loaded after the other fonts were.  The package
2584 does not affect @code{\\tt}, @code{\\texttt}, etc.")
2585     (license license:lppl1.2+)))
2587 (define-public texlive-latex-anysize
2588   (package
2589     (name "texlive-latex-anysize")
2590     (version (number->string %texlive-revision))
2591     (source (origin
2592               (method svn-fetch)
2593               (uri (svn-reference
2594                     (url (string-append "svn://www.tug.org/texlive/tags/"
2595                                         %texlive-tag "/Master/texmf-dist/"
2596                                         "/tex/latex/anysize"))
2597                     (revision %texlive-revision)))
2598               (file-name (string-append name "-" version "-checkout"))
2599               (sha256
2600                (base32
2601                 "19khwqjlvznc955sijhww3c4zbb0053rvzwv9nz738qknq7y18vb"))))
2602     (build-system trivial-build-system)
2603     (arguments
2604      `(#:modules ((guix build utils))
2605        #:builder
2606        (begin
2607          (use-modules (guix build utils))
2608          (let ((target (string-append (assoc-ref %outputs "out")
2609                                       "/share/texmf-dist/tex/latex/anysize")))
2610            (mkdir-p target)
2611            (copy-recursively (assoc-ref %build-inputs "source") target)
2612            #t))))
2613     (home-page "https://www.ctan.org/pkg/anysize")
2614     (synopsis "Simple package to set up document margins")
2615     (description
2616      "This is a simple package to set up document margins.  This package is
2617 considered obsolete; alternatives are the @code{typearea} package from the
2618 @code{koma-script} bundle, or the @code{geometry} package.")
2619     (license license:public-domain)))
2621 (define-public texlive-latex-appendix
2622   (package
2623     (name "texlive-latex-appendix")
2624     (version (number->string %texlive-revision))
2625     (source (origin
2626               (method svn-fetch)
2627               (uri (texlive-ref "latex" "appendix"))
2628               (file-name (string-append name "-" version "-checkout"))
2629               (sha256
2630                (base32
2631                 "0rxfpr8vq3brwx5rc7qn91ixlp9zva4zrms8a579fqa1g5yva7vg"))))
2632     (build-system texlive-build-system)
2633     (arguments '(#:tex-directory "latex/appendix"))
2634     (home-page "https://www.ctan.org/pkg/appendix")
2635     (synopsis "Extra control of appendices")
2636     (description
2637      "The appendix package provides various ways of formatting the titles of
2638 appendices.  Also (sub)appendices environments are provided that can be used,
2639 for example, for per chapter/section appendices.  An @code{appendices}
2640 environment is provided which can be used instead of the @code{\\appendix}
2641 command.")
2642     (license license:lppl)))
2644 (define-public texlive-latex-changebar
2645   (package
2646     (name "texlive-latex-changebar")
2647     (version (number->string %texlive-revision))
2648     (source (origin
2649               (method svn-fetch)
2650               (uri (texlive-ref "latex" "changebar"))
2651               (file-name (string-append name "-" version "-checkout"))
2652               (sha256
2653                (base32
2654                 "1ik4m8pzfsn1grlda6fniqqfwmgj7rfxwg63jdw0p0qv002vc7ik"))))
2655     (build-system texlive-build-system)
2656     (arguments '(#:tex-directory "latex/changebar"))
2657     (home-page "https://www.ctan.org/pkg/changebar")
2658     (synopsis "Generate changebars in LaTeX documents")
2659     (description
2660      "Identify areas of text to be marked with changebars with the
2661 @code{\\cbstart} and @code{\\cbend} commands; the bars may be coloured.  The
2662 package uses 'drivers' to place the bars; the available drivers can work with
2663 @code{dvitoln03}, @code{dvitops}, @code{dvips}, the emTeX and TeXtures DVI
2664 drivers, and VTeX and pdfTeX.")
2665     (license license:lppl)))
2667 (define-public texlive-latex-cmap
2668   (package
2669     (name "texlive-latex-cmap")
2670     (version (number->string %texlive-revision))
2671     (source (origin
2672               (method svn-fetch)
2673               (uri (svn-reference
2674                     (url (string-append "svn://www.tug.org/texlive/tags/"
2675                                         %texlive-tag "/Master/texmf-dist/"
2676                                         "/tex/latex/cmap"))
2677                     (revision %texlive-revision)))
2678               (file-name (string-append name "-" version "-checkout"))
2679               (sha256
2680                (base32
2681                 "1s1rv6zgw105w2j6ffhnk914qrix87y1ndzri1q72g2kbr91zlbg"))))
2682     (build-system trivial-build-system)
2683     (arguments
2684      `(#:modules ((guix build utils))
2685        #:builder
2686        (begin
2687          (use-modules (guix build utils))
2688          (let ((target (string-append (assoc-ref %outputs "out")
2689                                       "/share/texmf-dist/tex/latex/cmap")))
2690            (mkdir-p target)
2691            (copy-recursively (assoc-ref %build-inputs "source") target)
2692            #t))))
2693     (home-page "https://www.tug.org/svn/texlive/tags/texlive-2017.1/\
2694 Master/texmf-dist/tex/latex/cmap/")
2695     (synopsis "CMap support for PDF files")
2696     (description
2697      "This package embeds CMap tables into PDF files to make search and
2698 copy-and-paste functions work properly.")
2699     (license license:lppl)))
2701 (define-public texlive-latex-colortbl
2702   (package
2703     (name "texlive-latex-colortbl")
2704     (version (number->string %texlive-revision))
2705     (source (origin
2706               (method svn-fetch)
2707               (uri (texlive-ref "latex" "colortbl"))
2708               (file-name (string-append name "-" version "-checkout"))
2709               (sha256
2710                (base32
2711                 "190pmq8la2rq07xry8bn8z8yywzxv6fqyqaj7yjfj5rgw6x0mas8"))))
2712     (build-system texlive-build-system)
2713     (arguments '(#:tex-directory "latex/colortbl"))
2714     (home-page "https://www.ctan.org/pkg/colortbl")
2715     (synopsis "Add colour to LaTeX tables")
2716     (description
2717      "This package allows rows, columns, and even individual cells in LaTeX
2718 tables to be coloured.")
2719     (license license:lppl)))
2721 (define-public texlive-latex-fancybox
2722   (package
2723     (name "texlive-latex-fancybox")
2724     (version (number->string %texlive-revision))
2725     (source (origin
2726               (method svn-fetch)
2727               (uri (svn-reference
2728                     (url (string-append "svn://www.tug.org/texlive/tags/"
2729                                         %texlive-tag "/Master/texmf-dist/"
2730                                         "/tex/latex/fancybox"))
2731                     (revision %texlive-revision)))
2732               (file-name (string-append name "-" version "-checkout"))
2733               (sha256
2734                (base32
2735                 "0smmnaad2q8qwicay1frri990lv65l0k8cwzsvdsyp3jk8kp042w"))))
2736     (build-system trivial-build-system)
2737     (arguments
2738      `(#:modules ((guix build utils))
2739        #:builder
2740        (begin
2741          (use-modules (guix build utils))
2742          (let ((target (string-append (assoc-ref %outputs "out")
2743                                       "/share/texmf-dist/tex/latex/fancybox")))
2744            (mkdir-p target)
2745            (copy-recursively (assoc-ref %build-inputs "source") target)
2746            #t))))
2747     (home-page "https://www.ctan.org/pkg/fancybox")
2748     (synopsis "Variants of \\fbox and other games with boxes")
2749     (description
2750      "This package provides variants of @code{\\fbox}: @code{\\shadowbox},
2751 @code{\\doublebox}, @code{\\ovalbox}, @code{\\Ovalbox}, with helpful tools for
2752 using box macros and flexible verbatim macros.  You can box mathematics,
2753 floats, center, flushleft, and flushright, lists, and pages.")
2754     (license license:lppl1.2+)))
2756 (define-public texlive-latex-fancyhdr
2757   (package
2758     (name "texlive-latex-fancyhdr")
2759     (version (number->string %texlive-revision))
2760     (source (origin
2761               (method svn-fetch)
2762               (uri (svn-reference
2763                     (url (string-append "svn://www.tug.org/texlive/tags/"
2764                                         %texlive-tag "/Master/texmf-dist/"
2765                                         "/tex/latex/fancyhdr"))
2766                     (revision %texlive-revision)))
2767               (file-name (string-append name "-" version "-checkout"))
2768               (sha256
2769                (base32
2770                 "04h430agf8aj7ziwyb46xpk95c605rjk1wzhr63m6ylipihidlgw"))))
2771     (build-system trivial-build-system)
2772     (arguments
2773      `(#:modules ((guix build utils))
2774        #:builder
2775        (begin
2776          (use-modules (guix build utils))
2777          (let ((target (string-append (assoc-ref %outputs "out")
2778                                       "/share/texmf-dist/tex/latex/fancyhdr")))
2779            (mkdir-p target)
2780            (copy-recursively (assoc-ref %build-inputs "source") target)
2781            #t))))
2782     (home-page "https://www.ctan.org/pkg/fancyhdr")
2783     (synopsis "Extensive control of page headers and footers in LaTeX2e")
2784     (description
2785      "The package provides extensive facilities, both for constructing headers
2786 and footers, and for controlling their use (for example, at times when LaTeX
2787 would automatically change the heading style in use).")
2788     (license license:lppl)))
2790 (define-public texlive-latex-float
2791   (package
2792     (name "texlive-latex-float")
2793     (version (number->string %texlive-revision))
2794     (source (origin
2795               (method svn-fetch)
2796               (uri (texlive-ref "latex" "float"))
2797               (file-name (string-append name "-" version "-checkout"))
2798               (sha256
2799                (base32
2800                 "0nbl7wylkv22fcdv4p8byhhj575fli6jnqjpkhrkbv8dzwah84nq"))))
2801     (build-system texlive-build-system)
2802     (arguments '(#:tex-directory "latex/float"))
2803     (home-page "https://www.ctan.org/pkg/float")
2804     (synopsis "Improved interface for floating objects")
2805     (description
2806      "This package improves the interface for defining floating objects such
2807 as figures and tables.  It introduces the boxed float, the ruled float and the
2808 plaintop float.  You can define your own floats and improve the behaviour of
2809 the old ones.  The package also provides the @code{H} float modifier option of
2810 the obsolete @code{here} package.  You can select this as automatic default
2811 with @code{\\floatplacement{figure}{H}}.")
2812     (license license:lppl)))
2814 (define-public texlive-latex-footmisc
2815   (package
2816     (name "texlive-latex-footmisc")
2817     (version (number->string %texlive-revision))
2818     (source (origin
2819               (method svn-fetch)
2820               (uri (texlive-ref "latex" "footmisc"))
2821               (file-name (string-append name "-" version "-checkout"))
2822               (sha256
2823                (base32
2824                 "03x61wwql8nh6zrqiiiq3rb0x7m3pn48c606zapy19y21fybwdxs"))))
2825     (build-system texlive-build-system)
2826     (arguments '(#:tex-directory "latex/footmisc"))
2827     (home-page "https://www.ctan.org/pkg/footmisc")
2828     (synopsis "Range of footnote options")
2829     (description
2830      "This is a collection of ways to change the typesetting of footnotes.
2831 The package provides means of changing the layout of the footnotes themselves,
2832 a way to number footnotes per page, to make footnotes disappear in a
2833 \"moving\" argument, and to deal with multiple references to footnotes from
2834 the same place.  The package also has a range of techniques for labelling
2835 footnotes with symbols rather than numbers.")
2836     (license license:lppl1.3+)))
2838 (define-public texlive-latex-listings
2839   (package
2840     (name "texlive-latex-listings")
2841     (version (number->string %texlive-revision))
2842     (source (origin
2843               (method svn-fetch)
2844               (uri (texlive-ref "latex" "listings"))
2845               (file-name (string-append name "-" version "-checkout"))
2846               (sha256
2847                (base32
2848                 "1nsn9wp3wl12b36c0sqrim33lf33cr5wky0h4ncnw8lvqgm7h8wf"))))
2849     (build-system texlive-build-system)
2850     (arguments
2851      '(#:tex-directory "latex/listings"
2852        #:build-targets '("listings.ins")))
2853     (home-page "https://www.ctan.org/pkg/listings")
2854     (synopsis "Typeset source code listings using LaTeX")
2855     (description
2856      "The package enables the user to typeset programs (programming code)
2857 within LaTeX; the source code is read directly by TeX---no front-end processor
2858 is needed.  Keywords, comments and strings can be typeset using different
2859 styles.  Support for @code{hyperref} is provided.")
2860     (license license:lppl1.3+)))
2862 (define-public texlive-latex-jknapltx
2863   (package
2864     (name "texlive-latex-jknapltx")
2865     (version (number->string %texlive-revision))
2866     (source (origin
2867               (method svn-fetch)
2868               (uri (svn-reference
2869                     (url (string-append "svn://www.tug.org/texlive/tags/"
2870                                         %texlive-tag "/Master/texmf-dist/"
2871                                         "/tex/latex/jknapltx"))
2872                     (revision %texlive-revision)))
2873               (file-name (string-append name "-" version "-checkout"))
2874               (sha256
2875                (base32
2876                 "0m034x72f2g07icr50gacyxfb9g1lz2rmqh4kqr1qjb421x2kds9"))))
2877     (build-system trivial-build-system)
2878     (arguments
2879      `(#:modules ((guix build utils))
2880        #:builder
2881        (begin
2882          (use-modules (guix build utils))
2883          (let ((target (string-append (assoc-ref %outputs "out")
2884                                       "/share/texmf-dist/tex/latex/jknapltx")))
2885            (mkdir-p target)
2886            (copy-recursively (assoc-ref %build-inputs "source") target)
2887            #t))))
2888     (home-page "https://www.ctan.org/pkg/jknappen")
2889     (synopsis "Miscellaneous packages by Joerg Knappen")
2890     (description
2891      "This package provides miscellaneous macros by Joerg Knappen, including:
2892 represent counters in greek; Maxwell's non-commutative division;
2893 @code{latin1jk}, @code{latin2jk} and @code{latin3jk}, which are
2894 @code{inputenc} definition files that allow verbatim input in the respective
2895 ISO Latin codes; blackboard bold fonts in maths; use of RSFS fonts in maths;
2896 extra alignments for @code{\\parboxes}; swap Roman and Sans fonts;
2897 transliterate semitic languages; patches to make (La)TeX formulae embeddable
2898 in SGML; use maths minus in text as appropriate; simple Young tableaux.")
2899     (license license:gpl2)))
2901 (define-public texlive-fonts-ec
2902   (package
2903     (name "texlive-fonts-ec")
2904     (version (number->string %texlive-revision))
2905     (source (origin
2906               (method svn-fetch)
2907               (uri (svn-reference
2908                     (url (string-append "svn://www.tug.org/texlive/tags/"
2909                                         %texlive-tag "/Master/texmf-dist/"
2910                                         "/fonts/source/jknappen/ec/"))
2911                     (revision %texlive-revision)))
2912               (file-name (string-append name "-" version "-checkout"))
2913               (sha256
2914                (base32
2915                 "12av65fbz9xiashm09c9m1fj1mijxls5xspd7652ry1n5s0nixy4"))))
2916     (build-system gnu-build-system)
2917     (arguments
2918      `(#:modules ((guix build gnu-build-system)
2919                   (guix build utils)
2920                   (srfi srfi-1)
2921                   (srfi srfi-26))
2922        #:tests? #f                      ; no tests
2923        #:phases
2924        (modify-phases %standard-phases
2925          (delete 'configure)
2926          (replace 'build
2927            (lambda* (#:key inputs #:allow-other-keys)
2928              (let ((mf (assoc-ref inputs "texlive-metafont-base")))
2929                ;; Tell mf where to find mf.base
2930                (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
2931                ;; Tell mf where to look for source files
2932                (setenv "MFINPUTS"
2933                        (string-append (getcwd) ":"
2934                                       mf "/share/texmf-dist/metafont/base:"
2935                                       (assoc-ref inputs "texlive-fonts-cm")
2936                                       "/share/texmf-dist/fonts/source/public/cm")))
2937              (mkdir "build")
2938              (for-each (lambda (font)
2939                          (format #t "building font ~a\n" font)
2940                          (invoke "mf" "-progname=mf"
2941                                  "-output-directory=build"
2942                                  (string-append "\\"
2943                                                 "mode:=ljfour; "
2944                                                 "mag:=1; "
2945                                                 "batchmode; "
2946                                                 "input " (basename font ".mf"))))
2947                        (find-files "." "[0-9]+\\.mf$"))
2948              #t))
2949          (replace 'install
2950            (lambda* (#:key outputs #:allow-other-keys)
2951              (let* ((out (assoc-ref outputs "out"))
2952                     (tfm (string-append
2953                           out "/share/texmf-dist/fonts/tfm/jknappen/ec"))
2954                     (mf  (string-append
2955                           out "/share/texmf-dist/fonts/source/jknappen/ec")))
2956                (for-each (cut install-file <> tfm)
2957                          (find-files "build" "\\.*"))
2958                (for-each (cut install-file <> mf)
2959                          (find-files "." "\\.mf"))
2960                #t))))))
2961     (native-inputs
2962      `(("texlive-bin" ,texlive-bin)
2963        ("texlive-metafont-base" ,texlive-metafont-base)
2964        ("texlive-fonts-cm" ,texlive-fonts-cm)))
2965     (home-page "https://www.ctan.org/pkg/ec")
2966     (synopsis "Computer modern fonts in T1 and TS1 encodings")
2967     (description
2968      "The EC fonts are European Computer Modern Fonts, supporting the complete
2969 LaTeX T1 encoding defined at the 1990 TUG conference hold at Cork/Ireland.
2970 These fonts are intended to be stable with no changes being made to the tfm
2971 files.  The set also contains a Text Companion Symbol font, called @code{tc},
2972 featuring many useful characters needed in text typesetting, for example
2973 oldstyle digits, currency symbols (including the newly created Euro symbol),
2974 the permille sign, copyright, trade mark and servicemark as well as a copyleft
2975 sign, and many others.  Recent releases of LaTeX2e support the EC fonts.  The
2976 EC fonts supersede the preliminary version released as the DC fonts.  The
2977 fonts are available in (traced) Adobe Type 1 format, as part of the
2978 @code{cm-super} bundle.  The other Computer Modern-style T1-encoded Type 1
2979 set, Latin Modern, is not actually a direct development of the EC set, and
2980 differs from the EC in a number of particulars.")
2981     (license (license:fsf-free "https://www.tug.org/svn/texlive/tags/\
2982 texlive-2017.1/Master/texmf-dist/doc/fonts/ec/copyrite.txt"))))
2984 (define-public texlive-fonts-rsfs
2985   (package
2986     (name "texlive-fonts-rsfs")
2987     (version (number->string %texlive-revision))
2988     (source (origin
2989               (method svn-fetch)
2990               (uri (svn-reference
2991                     (url (string-append "svn://www.tug.org/texlive/tags/"
2992                                         %texlive-tag "/Master/texmf-dist/"
2993                                         "/fonts/source/public/rsfs/"))
2994                     (revision %texlive-revision)))
2995               (file-name (string-append name "-" version "-checkout"))
2996               (sha256
2997                (base32
2998                 "0r12pn02r4a955prcvq0048nifh86ihlcgvw3pppqqvfngv34l5h"))))
2999     (build-system gnu-build-system)
3000     (arguments
3001      `(#:modules ((guix build gnu-build-system)
3002                   (guix build utils)
3003                   (srfi srfi-1)
3004                   (srfi srfi-26))
3005        #:tests? #f                      ; no tests
3006        #:phases
3007        (modify-phases %standard-phases
3008          (delete 'configure)
3009          (replace 'build
3010            (lambda* (#:key inputs #:allow-other-keys)
3011              (let ((mf (assoc-ref inputs "texlive-metafont-base")))
3012                ;; Tell mf where to find mf.base
3013                (setenv "MFBASES" (string-append mf "/share/texmf-dist/web2c"))
3014                ;; Tell mf where to look for source files
3015                (setenv "MFINPUTS"
3016                        (string-append (getcwd) ":"
3017                                       mf "/share/texmf-dist/metafont/base:"
3018                                       (assoc-ref inputs "texlive-fonts-cm")
3019                                       "/share/texmf-dist/fonts/source/public/cm")))
3020              (mkdir "build")
3021              (for-each (lambda (font)
3022                          (format #t "building font ~a\n" font)
3023                          (invoke "mf" "-progname=mf"
3024                                  "-output-directory=build"
3025                                  (string-append "\\"
3026                                                 "mode:=ljfour; "
3027                                                 "mag:=1; "
3028                                                 "batchmode; "
3029                                                 "input " (basename font ".mf"))))
3030                        (find-files "." "[0-9]+\\.mf$"))
3031              #t))
3032          (replace 'install
3033            (lambda* (#:key outputs #:allow-other-keys)
3034              (let* ((out (assoc-ref outputs "out"))
3035                     (tfm (string-append
3036                           out "/share/texmf-dist/fonts/tfm/public/rsfs"))
3037                     (mf  (string-append
3038                           out "/share/texmf-dist/fonts/source/public/rsfs")))
3039                (for-each (cut install-file <> tfm)
3040                          (find-files "build" "\\.*"))
3041                (for-each (cut install-file <> mf)
3042                          (find-files "." "\\.mf"))
3043                #t))))))
3044     (native-inputs
3045      `(("texlive-bin" ,texlive-bin)
3046        ("texlive-metafont-base" ,texlive-metafont-base)
3047        ("texlive-fonts-cm" ,texlive-fonts-cm)))
3048     (home-page "https://www.ctan.org/pkg/rsfs")
3049     (synopsis "Ralph Smith's Formal Script font")
3050     (description
3051      "The fonts provide uppercase formal script letters for use as symbols in
3052 scientific and mathematical typesetting (in contrast to the informal script
3053 fonts such as that used for the calligraphic symbols in the TeX maths symbol
3054 font).  The fonts are provided as Metafont source, and as derived Adobe Type 1
3055 format.  LaTeX support, for using these fonts in mathematics, is available via
3056 one of the packages @code{calrsfs} and @code{mathrsfs}.")
3057     (license (license:fsf-free "http://mirrors.ctan.org/fonts/rsfs/README"))))
3059 (define-public texlive-latex-eso-pic
3060   (package
3061     (name "texlive-latex-eso-pic")
3062     (version (number->string %texlive-revision))
3063     (source (origin
3064               (method svn-fetch)
3065               (uri (texlive-ref "latex" "eso-pic"))
3066               (file-name (string-append name "-" version "-checkout"))
3067               (sha256
3068                (base32
3069                 "1xvmms28mvvfpks9x7lfya2xhh5k8jy3qnlih1mzcnf156xnb89z"))))
3070     (build-system texlive-build-system)
3071     (arguments '(#:tex-directory "latex/eso-pic"))
3072     (home-page "https://www.ctan.org/pkg/eso-pic")
3073     (synopsis "Add picture commands (or backgrounds) to every page")
3074     (description
3075      "The package adds one or more user commands to LaTeX's @code{shipout}
3076 routine, which may be used to place the output at fixed positions.  The
3077 @code{grid} option may be used to find the correct places.")
3078     (license license:lppl1.3+)))
3080 (define-public texlive-latex-eepic
3081   (package
3082     (name "texlive-latex-eepic")
3083     (version (number->string %texlive-revision))
3084     (source (origin
3085               (method svn-fetch)
3086               (uri (svn-reference
3087                     (url (string-append "svn://www.tug.org/texlive/tags/"
3088                                         %texlive-tag "/Master/texmf-dist/"
3089                                         "/tex/latex/eepic"))
3090                     (revision %texlive-revision)))
3091               (file-name (string-append name "-" version "-checkout"))
3092               (sha256
3093                (base32
3094                 "1c68gvh021pvybg07apsd2xhq2ljbg80kq94wh71drdga3c2zqjw"))))
3095     (build-system trivial-build-system)
3096     (arguments
3097      `(#:modules ((guix build utils))
3098        #:builder
3099        (begin
3100          (use-modules (guix build utils))
3101          (let ((target (string-append (assoc-ref %outputs "out")
3102                                       "/share/texmf-dist/tex/latex/eepic")))
3103            (mkdir-p target)
3104            (copy-recursively (assoc-ref %build-inputs "source") target)
3105            #t))))
3106     (home-page "https://www.ctan.org/pkg/eepic")
3107     (synopsis "Extensions to epic and the LaTeX drawing tools")
3108     (description
3109      "Extensions to @code{epic} and the LaTeX picture drawing environment,
3110 include the drawing of lines at any slope, the drawing of circles in any
3111 radii, and the drawing of dotted and dashed lines much faster with much less
3112 TeX memory, and providing several new commands for drawing ellipses, arcs,
3113 splines, and filled circles and ellipses.  The package uses @code{tpic}
3114 @code{\\special} commands.")
3115     (license license:public-domain)))
3117 (define-public texlive-latex-enumitem
3118   (package
3119     (name "texlive-latex-enumitem")
3120     (version (number->string %texlive-revision))
3121     (source (origin
3122               (method svn-fetch)
3123               (uri (svn-reference
3124                     (url (string-append "svn://www.tug.org/texlive/tags/"
3125                                         %texlive-tag "/Master/texmf-dist/"
3126                                         "/tex/latex/enumitem"))
3127                     (revision %texlive-revision)))
3128               (file-name (string-append name "-" version "-checkout"))
3129               (sha256
3130                (base32
3131                 "0q24b1bkdi9l6bw787bpggww83jh2vj8955aw2m5yccqbx4vgr5r"))))
3132     (build-system trivial-build-system)
3133     (arguments
3134      `(#:modules ((guix build utils))
3135        #:builder
3136        (begin
3137          (use-modules (guix build utils))
3138          (let ((target (string-append (assoc-ref %outputs "out")
3139                                       "/share/texmf-dist/tex/latex/enumitem")))
3140            (mkdir-p target)
3141            (copy-recursively (assoc-ref %build-inputs "source") target)
3142            #t))))
3143     (home-page "https://www.ctan.org/pkg/enumitem")
3144     (synopsis "Customize basic list environments")
3145     (description
3146      "This package is intended to ease customizing the three basic list
3147 environments: @code{enumerate}, @code{itemize} and @code{description}.  It
3148 extends their syntax to allow an optional argument where a set of parameters
3149 in the form @code{key=value} are available, for example:
3150 @code{\\begin{itemize}[itemsep=1ex,leftmargin=1cm]}.")
3151     (license license:lppl1.3+)))
3153 (define-public texlive-latex-multirow
3154   (package
3155     (name "texlive-latex-multirow")
3156     (version (number->string %texlive-revision))
3157     (source (origin
3158               (method svn-fetch)
3159               (uri (texlive-ref "latex" "multirow"))
3160               (file-name (string-append name "-" version "-checkout"))
3161               (sha256
3162                (base32
3163                 "0qlxy47f1f8plgch3jqfsnrdgpyz20sz46yp33i2jwvf9hvfczf0"))))
3164     (build-system texlive-build-system)
3165     (arguments '(#:tex-directory "latex/multirow"))
3166     (home-page "https://www.ctan.org/pkg/multirow")
3167     (synopsis "Create tabular cells spanning multiple rows")
3168     (description
3169      "The package provides tools for creating tabular cells spanning multiple
3170 rows.  It has a lot of flexibility, including an option for specifying an
3171 entry at the \"natural\" width of its text.")
3172     (license license:lppl1.3+)))
3174 (define-public texlive-latex-overpic
3175   (package
3176     (name "texlive-latex-overpic")
3177     (version (number->string %texlive-revision))
3178     (source (origin
3179               (method svn-fetch)
3180               (uri (svn-reference
3181                     (url (string-append "svn://www.tug.org/texlive/tags/"
3182                                         %texlive-tag "/Master/texmf-dist/"
3183                                         "/tex/latex/overpic"))
3184                     (revision %texlive-revision)))
3185               (file-name (string-append name "-" version "-checkout"))
3186               (sha256
3187                (base32
3188                 "0m29q9qdb00558b7g2i7iw6w62n5s46yx81j8m99qkv77magk4fm"))))
3189     (build-system trivial-build-system)
3190     (arguments
3191      `(#:modules ((guix build utils))
3192        #:builder
3193        (begin
3194          (use-modules (guix build utils))
3195          (let ((target (string-append (assoc-ref %outputs "out")
3196                                       "/share/texmf-dist/tex/latex/overpic")))
3197            (mkdir-p target)
3198            (copy-recursively (assoc-ref %build-inputs "source") target)
3199            #t))))
3200     (home-page "https://www.ctan.org/pkg/overpic")
3201     (synopsis "Combine LaTeX commands over included graphics")
3202     (description
3203      "The @code{overpic} environment is a cross between the LaTeX
3204 @code{picture} environment and the @code{\\includegraphics} command of
3205 @code{graphicx}.  The resulting picture environment has the same dimensions as
3206 the included graphic.  LaTeX commands can be placed on the graphic at defined
3207 positions; a grid for orientation is available.")
3208     (license license:lppl1.0+)))
3210 (define-public texlive-latex-parskip
3211   (package
3212     (name "texlive-latex-parskip")
3213     (version (number->string %texlive-revision))
3214     (source (origin
3215               (method svn-fetch)
3216               (uri (svn-reference
3217                     (url (string-append "svn://www.tug.org/texlive/tags/"
3218                                         %texlive-tag "/Master/texmf-dist/"
3219                                         "/tex/latex/parskip"))
3220                     (revision %texlive-revision)))
3221               (file-name (string-append name "-" version "-checkout"))
3222               (sha256
3223                (base32
3224                 "14r6h9hqb0qgccxj5l1208694fx8sb8avmgzps36lsbbpszl7i7m"))))
3225     (build-system trivial-build-system)
3226     (arguments
3227      `(#:modules ((guix build utils))
3228        #:builder
3229        (begin
3230          (use-modules (guix build utils))
3231          (let ((target (string-append (assoc-ref %outputs "out")
3232                                       "/share/texmf-dist/tex/latex/parskip")))
3233            (mkdir-p target)
3234            (copy-recursively (assoc-ref %build-inputs "source") target)
3235            #t))))
3236     (home-page "https://www.ctan.org/pkg/parskip")
3237     (synopsis "Layout with zero \\parindent, non-zero \\parskip")
3238     (description
3239      "Simply changing @code{\\parskip} and @code{\\parindent} leaves a layout
3240 that is untidy; this package (though it is no substitute for a properly
3241 designed class) helps alleviate this untidiness.")
3242     (license license:lppl)))
3244 (define-public texlive-latex-pdfpages
3245   (package
3246     (name "texlive-latex-pdfpages")
3247     (version (number->string %texlive-revision))
3248     (source (origin
3249               (method svn-fetch)
3250               (uri (texlive-ref "latex" "pdfpages"))
3251               (file-name (string-append name "-" version "-checkout"))
3252               (sha256
3253                (base32
3254                 "06p5smfq66559ppdnmkl3hp8534x84ywbscimsiir4gllpya3i9h"))))
3255     (build-system texlive-build-system)
3256     (arguments '(#:tex-directory "latex/pdfpages"))
3257     (home-page "https://www.ctan.org/pkg/pdfpages")
3258     (synopsis "Include PDF documents in LaTeX")
3259     (description
3260      "This package simplifies the inclusion of external multi-page PDF
3261 documents in LaTeX documents.  Pages may be freely selected and it is possible
3262 to put several logical pages onto each sheet of paper.  Furthermore a lot of
3263 hypertext features like hyperlinks and article threads are provided.  The
3264 package supports pdfTeX (pdfLaTeX) and VTeX.  With VTeX it is even possible to
3265 use this package to insert PostScript files, in addition to PDF files.")
3266     (license license:lppl1.3+)))
3268 (define-public texlive-fonts-stmaryrd
3269   (package
3270     (name "texlive-fonts-stmaryrd")
3271     (version (number->string %texlive-revision))
3272     (source (origin
3273               (method svn-fetch)
3274               (uri (texlive-ref "fonts" "stmaryrd"))
3275               (file-name (string-append name "-" version "-checkout"))
3276               (sha256
3277                (base32
3278                 "08pn4ca3vl6qm9l3wm5h5iyjsrg411kkm1yana329xwg2j14s9n6"))))
3279     (build-system texlive-build-system)
3280     (arguments
3281      '(#:tex-directory "latex/stmaryrd"
3282        #:phases
3283        (modify-phases %standard-phases
3284          (add-after 'configure 'patch-ins
3285            (lambda _
3286              (substitute* "stmaryrd.ins"
3287                (("^%% LaTeX2e.*") "\\input docstrip\n")
3288                (("fontdef\\}\\}" line)
3289                 (string-append line "\n\\endbatchfile")))
3290              #t)))))
3291     (home-page "https://www.ctan.org/pkg/stmaryrd")
3292     (synopsis "St Mary Road symbols for theoretical computer science")
3293     (description
3294      "The fonts were originally distributed as Metafont sources only, but
3295 Adobe Type 1 versions are also now available.  Macro support is provided for
3296 use under LaTeX; the package supports the @code{only} option (provided by the
3297 @code{somedefs} package) to restrict what is loaded, for those who don't need
3298 the whole font.")
3299     (license license:lppl)))
3301 (define-public texlive-latex-subfigure
3302   (package
3303     (name "texlive-latex-subfigure")
3304     (version (number->string %texlive-revision))
3305     (source (origin
3306               (method svn-fetch)
3307               (uri (texlive-ref "latex" "subfigure"))
3308               (file-name (string-append name "-" version "-checkout"))
3309               (sha256
3310                (base32
3311                 "15spcl5wb7w269qd6y596vp4yi8sa5ppcx8w4z2i9kyp02r3a0yb"))))
3312     (build-system texlive-build-system)
3313     (arguments '(#:tex-directory "latex/subfigure"))
3314     (home-page "https://www.ctan.org/pkg/subfigure")
3315     (synopsis "Figures divided into subfigures")
3316     (description
3317      "This (deprecated) package provides support for the manipulation and
3318 reference of small or \"sub\" figures and tables within a single figure or
3319 table environment.  It is convenient to use this package when your subfigures
3320 are to be separately captioned, referenced, or are to be included in the
3321 List-of-Figures.  A new @code{\\subfigure} command is introduced which can be
3322 used inside a figure environment for each subfigure.  An optional first
3323 argument is used as the caption for that subfigure.  The package is now
3324 considered obsolete: it was superseded by @code{subfig}, but users may find
3325 the more recent @code{subcaption} package more satisfactory.")
3326     (license license:lppl)))
3328 (define-public texlive-latex-tabulary
3329   (package
3330     (name "texlive-latex-tabulary")
3331     (version (number->string %texlive-revision))
3332     (source (origin
3333               (method svn-fetch)
3334               (uri (texlive-ref "latex" "tabulary"))
3335               (file-name (string-append name "-" version "-checkout"))
3336               (sha256
3337                (base32
3338                 "1adkdx2zkk42g82nqf57lv1nc1z7kwl13jmy8vpcsizsa0xdnx9n"))))
3339     (build-system texlive-build-system)
3340     (arguments '(#:tex-directory "latex/tabulary"))
3341     (home-page "https://www.ctan.org/pkg/tabulary")
3342     (synopsis "Tabular with variable width columns balanced")
3343     (description
3344      "The package defines a @code{tabular*}-like environment, @code{tabulary},
3345 taking a \"total width\" argument as well as the column specifications.  The
3346 environment uses column types @code{L}, @code{C}, @code{R} and @code{J} for
3347 variable width columns (@code{\\raggedright}, @code{\\centering},
3348 @code{\\raggedleft}, and normally justified).  In contrast to
3349 @code{tabularx}'s @code{X} columns, the width of each column is weighted
3350 according to the natural width of the widest cell in the column.")
3351     (license license:lppl)))
3353 (define-public texlive-latex-threeparttable
3354   (package
3355     (name "texlive-latex-threeparttable")
3356     (version (number->string %texlive-revision))
3357     (source (origin
3358               (method svn-fetch)
3359               (uri (svn-reference
3360                     (url (string-append "svn://www.tug.org/texlive/tags/"
3361                                         %texlive-tag "/Master/texmf-dist/"
3362                                         "/tex/latex/threeparttable"))
3363                     (revision %texlive-revision)))
3364               (file-name (string-append name "-" version "-checkout"))
3365               (sha256
3366                (base32
3367                 "10vy9k150w2lviw8h22s2mcykff38xci653m5823s2vv44pwbmzq"))))
3368     (build-system trivial-build-system)
3369     (arguments
3370      `(#:modules ((guix build utils))
3371        #:builder
3372        (begin
3373          (use-modules (guix build utils))
3374          (let ((target (string-append (assoc-ref %outputs "out")
3375                                       "/share/texmf-dist/tex/latex/threeparttable")))
3376            (mkdir-p target)
3377            (copy-recursively (assoc-ref %build-inputs "source") target)
3378            #t))))
3379     (home-page "https://www.ctan.org/pkg/threeparttable")
3380     (synopsis "Tables with captions and notes all the same width")
3381     (description
3382      "This package facilitates tables with titles (captions) and notes.  The
3383 title and notes are given a width equal to the body of the table (a
3384 @code{tabular} environment).  By itself, a @code{threeparttable} does not
3385 float, but you can put it in a @code{table} or a @code{table*} or some other
3386 environment.")
3387     (license (license:fsf-free "file://threeparttable.sty"))))
3389 (define-public texlive-fonts-txfonts
3390   (package
3391     (name "texlive-fonts-txfonts")
3392     (version (number->string %texlive-revision))
3393     (source (origin
3394               (method svn-fetch)
3395               (uri (svn-reference
3396                     (url (string-append "svn://www.tug.org/texlive/tags/"
3397                                         %texlive-tag "/Master/texmf-dist/"
3398                                         "/tex/latex/txfonts"))
3399                     (revision %texlive-revision)))
3400               (file-name (string-append name "-" version "-checkout"))
3401               (sha256
3402                (base32
3403                 "0jl921qdphg8i7bkfprackn3xd4gmvxckc526nmzqsmahqkavgg2"))))
3404     (build-system trivial-build-system)
3405     (arguments
3406      `(#:modules ((guix build utils)
3407                   (ice-9 match))
3408        #:builder
3409        (begin
3410          (use-modules (guix build utils)
3411                       (ice-9 match))
3412          (let ((root (string-append (assoc-ref %outputs "out")
3413                                     "/share/texmf-dist/"))
3414                (pkgs '(("source"        . "tex/latex/txfonts")
3415                        ("txfonts-vf"    . "fonts/tfm/public/txfonts")
3416                        ("txfonts-afm"   . "fonts/afm/public/txfonts")
3417                        ("txfonts-tfm"   . "fonts/tfm/public/txfonts")
3418                        ("txfonts-type1" . "fonts/type1/public/txfonts")
3419                        ("txfonts-enc"   . "fonts/enc/dvips/txfonts")
3420                        ("txfonts-map"   . "fonts/map/dvips/txfonts"))))
3421            (for-each (match-lambda
3422                        ((pkg . dir)
3423                         (let ((target (string-append root dir)))
3424                           (mkdir-p target)
3425                           (copy-recursively (assoc-ref %build-inputs pkg)
3426                                             target))))
3427                      pkgs)
3428            #t))))
3429     (native-inputs
3430      `(("txfonts-tfm"
3431         ,(origin
3432            (method svn-fetch)
3433            (uri (svn-reference
3434                  (url (string-append "svn://www.tug.org/texlive/tags/"
3435                                      %texlive-tag "/Master/texmf-dist/"
3436                                      "/fonts/tfm/public/txfonts"))
3437                  (revision %texlive-revision)))
3438            (file-name (string-append name "-tfm-" version "-checkout"))
3439            (sha256
3440             (base32
3441              "12ffmbrp48ap35qa3b4mi6ckif9q2vf7972jxh5dc1yzykhla2xv"))))
3442        ("txfonts-vf"
3443         ,(origin
3444            (method svn-fetch)
3445            (uri (svn-reference
3446                  (url (string-append "svn://www.tug.org/texlive/tags/"
3447                                      %texlive-tag "/Master/texmf-dist/"
3448                                      "/fonts/vf/public/txfonts"))
3449                  (revision %texlive-revision)))
3450            (file-name (string-append name "-vf-" version "-checkout"))
3451            (sha256
3452             (base32
3453              "04acyfdwvxpfx4l2xh2bpzdmpvwdf2pzbs7a236b0xckz2jvc1ci"))))
3454        ("txfonts-afm"
3455         ,(origin
3456            (method svn-fetch)
3457            (uri (svn-reference
3458                  (url (string-append "svn://www.tug.org/texlive/tags/"
3459                                      %texlive-tag "/Master/texmf-dist/"
3460                                      "/fonts/afm/public/txfonts"))
3461                  (revision %texlive-revision)))
3462            (file-name (string-append name "-afm-" version "-checkout"))
3463            (sha256
3464             (base32
3465              "1705klz51pnqzcs89s3521b84b6c89wlczflsh0vci66nl155yis"))))
3466        ("txfonts-type1"
3467         ,(origin
3468            (method svn-fetch)
3469            (uri (svn-reference
3470                  (url (string-append "svn://www.tug.org/texlive/tags/"
3471                                      %texlive-tag "/Master/texmf-dist/"
3472                                      "/fonts/type1/public/txfonts"))
3473                  (revision %texlive-revision)))
3474            (file-name (string-append name "-type1-" version "-checkout"))
3475            (sha256
3476             (base32
3477              "0ajwr7zb6ch3gxd0g8p2i4llhy2wr9a9saz6jq6hm6fxf4pgl5h3"))))
3478        ("txfonts-map"
3479         ,(origin
3480            (method svn-fetch)
3481            (uri (svn-reference
3482                  (url (string-append "svn://www.tug.org/texlive/tags/"
3483                                      %texlive-tag "/Master/texmf-dist/"
3484                                      "/fonts/map/dvips/txfonts"))
3485                  (revision %texlive-revision)))
3486            (file-name (string-append name "-map-" version "-checkout"))
3487            (sha256
3488             (base32
3489              "0kamr8a9x24jakas3v09dgv7kkpybj3i7qv4vz1iyypqr6kk1raj"))))
3490        ("txfonts-enc"
3491         ,(origin
3492            (method svn-fetch)
3493            (uri (svn-reference
3494                  (url (string-append "svn://www.tug.org/texlive/tags/"
3495                                      %texlive-tag "/Master/texmf-dist/"
3496                                      "/fonts/enc/dvips/txfonts"))
3497                  (revision %texlive-revision)))
3498            (file-name (string-append name "-enc-" version "-checkout"))
3499            (sha256
3500             (base32
3501              "1bal5fhw0xlhl37ayv8vlnqnsn1y82kadzfjhbgr223blspp4zsj"))))))
3502     (home-page "https://www.ctan.org/pkg/threeparttable")
3503     (synopsis "Times-like fonts in support of mathematics")
3504     (description
3505      "Txfonts supplies virtual text roman fonts using Adobe Times (or URW
3506 NimbusRomNo9L) with some modified and additional text symbols in the OT1, T1,
3507 and TS1 encodings; maths alphabets using Times/URW Nimbus; maths fonts
3508 providing all the symbols of the Computer Modern and AMS fonts, including all
3509 the Greek capital letters from CMR; and additional maths fonts of various
3510 other symbols.
3512 The set is complemented by a sans-serif set of text fonts, based on
3513 Helvetica/NimbusSanL, and a monospace set.
3515 All the fonts are in Type 1 format (AFM and PFB files), and are supported by
3516 TeX metrics (VF and TFM files) and macros for use with LaTeX.")
3517     ;; Any version of the GPL with font exception.
3518     (license license:gpl3+)))
3520 (define-public texlive-fonts-iwona
3521   (package
3522     (name "texlive-fonts-iwona")
3523     (version "0.995b")
3524     (source (origin
3525               (method url-fetch)
3526               (uri (string-append "http://jmn.pl/pliki/Iwona-tex-"
3527                                   (string-map (lambda (c)
3528                                                 (if (char=? c #\.)
3529                                                     #\_ c))
3530                                               version)
3531                                   ".zip"))
3532               (sha256
3533                (base32
3534                 "13684iqx5granpc5rfvqnmyvdpgpbr1x9y7i7y7bcaq0qxv7ph1x"))))
3535     (build-system trivial-build-system)
3536     (arguments
3537      `(#:modules ((guix build utils))
3538        #:builder
3539        (begin
3540          (use-modules (guix build utils))
3541          (let ((target (string-append (assoc-ref %outputs "out")
3542                                       "/share/texmf-dist/"))
3543                (unzip  (string-append (assoc-ref %build-inputs "unzip")
3544                                       "/bin/unzip")))
3545            (invoke unzip (assoc-ref %build-inputs "source"))
3546            (mkdir-p target)
3547            (copy-recursively "iwona" target)
3548            #t))))
3549     (native-inputs
3550      `(("unzip" ,unzip)))
3551     (home-page "http://jmn.pl/en/kurier-i-iwona/")
3552     (synopsis "Sans-serif typeface for TeX")
3553     (description "Iwona is a two-element sans-serif typeface. It was created
3554 as an alternative version of the Kurier typeface, which was designed in 1975
3555 for a diploma in typeface design at the Warsaw Academy of Fine Arts under the
3556 supervision of Roman Tomaszewski.  Kurier was designed for linotype
3557 typesetting of newspapers and similar periodicals. The Iwona fonts are an
3558 alternative version of the Kurier fonts.  The difference lies in the absence
3559 of ink traps which typify the Kurier font.")
3560     (license license:gfl1.0)))
3562 (define-public texlive-latex-titlesec
3563   (package
3564     (name "texlive-latex-titlesec")
3565     (version (number->string %texlive-revision))
3566     (source (origin
3567               (method svn-fetch)
3568               (uri (svn-reference
3569                     (url (string-append "svn://www.tug.org/texlive/tags/"
3570                                         %texlive-tag "/Master/texmf-dist/"
3571                                         "/tex/latex/titlesec"))
3572                     (revision %texlive-revision)))
3573               (file-name (string-append name "-" version "-checkout"))
3574               (sha256
3575                (base32
3576                 "04nmkhqx6jxcxx9a30zbcd5smxi5fd0cbp132bki7fnvhspnhg21"))))
3577     (build-system trivial-build-system)
3578     (arguments
3579      `(#:modules ((guix build utils))
3580        #:builder
3581        (begin
3582          (use-modules (guix build utils))
3583          (let ((target (string-append (assoc-ref %outputs "out")
3584                                       "/share/texmf-dist/tex/latex/titlesec")))
3585            (mkdir-p target)
3586            (copy-recursively (assoc-ref %build-inputs "source") target)
3587            #t))))
3588     (home-page "https://www.ctan.org/pkg/titlesec")
3589     (synopsis "Select alternative section titles")
3590     (description
3591      "This package provides an interface to sectioning commands for selection
3592 from various title styles, e.g. for marginal titles and to change the font of
3593 all headings with a single command, also providing simple one-step page
3594 styles.  It also includes a package to change the page styles when there are
3595 floats in a page.  You may assign headers/footers to individual floats, too.")
3596     (license license:lppl)))
3598 (define-public texlive-latex-type1cm
3599   (package
3600     (name "texlive-latex-type1cm")
3601     (version (number->string %texlive-revision))
3602     (source (origin
3603               (method svn-fetch)
3604               (uri (texlive-ref "latex" "type1cm"))
3605               (file-name (string-append name "-" version "-checkout"))
3606               (sha256
3607                (base32
3608                 "1lvxrqfwcwa4p31zyfm80gr05v8c28xybv5ri79zi2ngz6834z12"))))
3609     (build-system texlive-build-system)
3610     (arguments '(#:tex-directory "latex/type1cm"))
3611     (home-page "https://www.ctan.org/pkg/type1cm")
3612     (synopsis "Arbitrary size font selection in LaTeX")
3613     (description
3614      "LaTeX, by default, restricts the sizes at which you can use its default
3615 computer modern fonts, to a fixed set of discrete sizes (effectively, a set
3616 specified by Knuth).  The @code{type1cm} package removes this restriction;
3617 this is particularly useful when using scalable versions of the CM
3618 fonts (Bakoma, or the versions from BSR/Y&Y, or True Type versions from Kinch,
3619 PCTeX, etc.).  In fact, since modern distributions will automatically generate
3620 any bitmap font you might need, @code{type1cm} has wider application than just
3621 those using scalable versions of the fonts.  Note that the LaTeX distribution
3622 now contains a package @code{fix-cm},f which performs the task of
3623 @code{type1cm}, as well as doing the same job for T1- and TS1-encoded
3624 @code{ec} fonts.")
3625     (license license:lppl)))
3627 (define-public texlive-latex-lh
3628   (package
3629     (name "texlive-latex-lh")
3630     (version (number->string %texlive-revision))
3631     (source (origin
3632               (method svn-fetch)
3633               (uri (texlive-ref "latex" "lh"))
3634               (file-name (string-append name "-" version "-checkout"))
3635               (sha256
3636                (base32
3637                 "00gdiwh3sfhh1iimjhpja7lm7k4vzqzql2irgwnpz94qvh25zwi5"))))
3638     (build-system texlive-build-system)
3639     (arguments '(#:tex-directory "latex/lh"))
3640     (home-page "https://www.ctan.org/pkg/lh")
3641     (synopsis "Cyrillic fonts that support LaTeX standard encodings")
3642     (description
3643      "The LH fonts address the problem of the wide variety of alphabets that
3644 are written with Cyrillic-style characters.  The fonts are the original basis
3645 of the set of T2* and X2 encodings that are now used when LaTeX users need to
3646 write in Cyrillic languages.  Macro support in standard LaTeX encodings is
3647 offered through the latex-cyrillic and t2 bundles, and the package itself
3648 offers support for other (more traditional) encodings.  The fonts, in the
3649 standard T2* and X2 encodings are available in Adobe Type 1 format, in the
3650 CM-Super family of fonts.  The package also offers its own LaTeX support for
3651 OT2 encoded fonts, CM bright shaped fonts and Concrete shaped fonts.")
3652     (license license:lppl)))
3654 (define-public texlive-metapost
3655   (package
3656     (name "texlive-metapost")
3657     (version (number->string %texlive-revision))
3658     (source (origin
3659               (method svn-fetch)
3660               (uri (svn-reference
3661                     (url (string-append "svn://www.tug.org/texlive/tags/"
3662                                         %texlive-tag "/Master/texmf-dist/"
3663                                         "/metapost"))
3664                     (revision %texlive-revision)))
3665               (file-name (string-append name "-" version "-checkout"))
3666               (sha256
3667                (base32
3668                 "03nvjddffiz796wll6axzmgfvynyciy2mqamv20qx252w71vwkwd"))))
3669     (build-system trivial-build-system)
3670     (arguments
3671      `(#:modules ((guix build utils))
3672        #:builder
3673        (begin
3674          (use-modules (guix build utils))
3675          (let ((target (string-append (assoc-ref %outputs "out")
3676                                       "/share/texmf-dist/metapost")))
3677            (mkdir-p target)
3678            (copy-recursively (assoc-ref %build-inputs "source") target)
3679            #t))))
3680     (home-page "https://www.ctan.org/pkg/metapost")
3681     (synopsis "Create scalable illustrations")
3682     (description
3683      "MetaPost uses a language based on that of Metafont to produce precise
3684 technical illustrations.  Its output is scalable PostScript or SVG, rather
3685 than the bitmaps Metafont creates.")
3686     (license license:lppl)))
3688 (define-public texlive-latex-acmart
3689   (package
3690     (name "texlive-latex-acmart")
3691     (version "1.45")
3692     (source (origin
3693               (method svn-fetch)
3694               (uri (texlive-ref "latex" "acmart"))
3695               (sha256
3696                (base32
3697                 "10zs8ga88ksypv1v4p6mynmfa7749q2hgxlr4shnwfjd9wrb421q"))
3698               (file-name (string-append name "-" version "-checkout"))))
3699     (build-system texlive-build-system)
3700     (arguments '(#:tex-directory "latex/acmart"))
3701     (home-page "https://www.ctan.org/pkg/acmart")
3702     (synopsis "Class for typesetting publications of ACM")
3703     (description
3704      "This package provides a class for typesetting publications of the
3705 Association for Computing Machinery (ACM).")
3706     (license license:lppl1.3+)))
3708 (define-public texlive-latex-varwidth
3709   (package
3710     (name "texlive-latex-varwidth")
3711     (version (number->string %texlive-revision))
3712     (source (origin
3713               (method svn-fetch)
3714               (uri (svn-reference
3715                     (url (string-append "svn://www.tug.org/texlive/tags/"
3716                                         %texlive-tag "/Master/texmf-dist/"
3717                                         "/tex/latex/varwidth"))
3718                     (revision %texlive-revision)))
3719               (file-name (string-append name "-" version "-checkout"))
3720               (sha256
3721                (base32
3722                 "1bmz9ap0ffyg7qry2xi7lki06qx4809w028xvk88cl66h7p46g52"))))
3723     (build-system trivial-build-system)
3724     (arguments
3725      `(#:modules ((guix build utils))
3726        #:builder
3727        (begin
3728          (use-modules (guix build utils))
3729          (let ((target (string-append (assoc-ref %outputs "out")
3730                                       "/share/texmf-dist/tex/latex/varwidth")))
3731            (mkdir-p target)
3732            (copy-recursively (assoc-ref %build-inputs "source") target)
3733            #t))))
3734     (home-page "https://www.ctan.org/pkg/varwidth")
3735     (synopsis "Variable-width minipage")
3736     (description
3737      "The @code{varwidth} environment is superficially similar to
3738 @code{minipage}, but the specified width is just a maximum value — the box may
3739 get a narrower “natural” width.")
3740     (license license:lppl)))
3742 (define-public texlive-latex-wasysym
3743   (package
3744     (name "texlive-latex-wasysym")
3745     (version (number->string %texlive-revision))
3746     (source (origin
3747               (method svn-fetch)
3748               (uri (texlive-ref "latex" "wasysym"))
3749               (file-name (string-append name "-" version "-checkout"))
3750               (sha256
3751                (base32
3752                 "1sgwbfwjjf70g54hh93gsd9jp9nm67w6n74x9d72a56n07jbk5hv"))))
3753     (build-system texlive-build-system)
3754     (arguments '(#:tex-directory "latex/wasysym"))
3755     (home-page "https://www.ctan.org/pkg/wasysym")
3756     (synopsis "LaTeX support file to use the WASY2 fonts")
3757     (description
3758      "The wasy2WASY2 (Waldi Symbol) font by Roland Waldi provides many glyphs
3759 like male and female symbols and astronomical symbols, as well as the complete
3760 lasy font set and other odds and ends.  The wasysym package implements an easy
3761 to use interface for these symbols.")
3762     (license license:lppl)))
3764 (define-public texlive-latex-wrapfig
3765   (package
3766     (name "texlive-latex-wrapfig")
3767     (version (number->string %texlive-revision))
3768     (source (origin
3769               (method svn-fetch)
3770               (uri (svn-reference
3771                     (url (string-append "svn://www.tug.org/texlive/tags/"
3772                                         %texlive-tag "/Master/texmf-dist/"
3773                                         "/tex/latex/wrapfig"))
3774                     (revision %texlive-revision)))
3775               (file-name (string-append name "-" version "-checkout"))
3776               (sha256
3777                (base32
3778                 "16xpyl0csmmwndz1xhzqfg9l0zcsnqxslsixsqkwd4zsvfj30sv4"))))
3779     (build-system trivial-build-system)
3780     (arguments
3781      `(#:modules ((guix build utils))
3782        #:builder
3783        (begin
3784          (use-modules (guix build utils))
3785          (let ((target (string-append (assoc-ref %outputs "out")
3786                                       "/share/texmf-dist/tex/latex/wrapfig")))
3787            (mkdir-p target)
3788            (copy-recursively (assoc-ref %build-inputs "source") target)
3789            #t))))
3790     (home-page "https://www.ctan.org/pkg/wrapfig")
3791     (synopsis "Produces figures which text can flow around")
3792     (description
3793      "This package allows figures or tables to have text wrapped around them.
3794 It does not work in combination with list environments, but can be used in a
3795 @code{parbox} or @code{minipage}, and in two-column format.")
3796     (license license:lppl)))
3798 (define-public texlive-latex-ucs
3799   (package
3800     (name "texlive-latex-ucs")
3801     (version (number->string %texlive-revision))
3802     (source (origin
3803               (method svn-fetch)
3804               (uri (svn-reference
3805                     (url (string-append "svn://www.tug.org/texlive/tags/"
3806                                         %texlive-tag "/Master/texmf-dist/"
3807                                         "/tex/latex/ucs"))
3808                     (revision %texlive-revision)))
3809               (file-name (string-append name "-" version "-checkout"))
3810               (sha256
3811                (base32
3812                 "0rrxwi60wmz5dfjifl4fwk66plf7wix85qnhfv4ylvmj6qi6hw37"))))
3813     (build-system trivial-build-system)
3814     (arguments
3815      `(#:modules ((guix build utils))
3816        #:builder
3817        (begin
3818          (use-modules (guix build utils))
3819          (let ((target (string-append (assoc-ref %outputs "out")
3820                                       "/share/texmf-dist/tex/latex/ucs")))
3821            (mkdir-p target)
3822            (copy-recursively (assoc-ref %build-inputs "source") target)
3823            #t))))
3824     (home-page "https://www.ctan.org/pkg/ucs")
3825     (synopsis "Extended UTF-8 input encoding support for LaTeX")
3826     (description
3827      "The bundle provides the @code{ucs} package, and @code{utf8x.def},
3828 together with a large number of support files.  The @code{utf8x.def}
3829 definition file for use with @code{inputenc} covers a wider range of Unicode
3830 characters than does @code{utf8.def} in the LaTeX distribution.  The package
3831 provides facilities for efficient use of its large sets of Unicode characters.
3832 Glyph production may be controlled by various options, which permits use of
3833 non-ASCII characters when coding mathematical formulae.  Note that the bundle
3834 previously had an alias “unicode”; that alias has now been withdrawn, and no
3835 package of that name now exists.")
3836     (license license:lppl1.3+)))
3838 (define-public texlive-latex-preview
3839   (package
3840     (name "texlive-latex-preview")
3841     (version (number->string %texlive-revision))
3842     (source (origin
3843               (method svn-fetch)
3844               (uri (texlive-ref "latex" "preview"))
3845               (file-name (string-append name "-" version "-checkout"))
3846               (sha256
3847                (base32
3848                 "0j6fff6q0ca96nwfdgay2jm55792z4q9aa0rczmiw2qccyg5n2dv"))))
3849     (build-system texlive-build-system)
3850     (arguments
3851      '(#:tex-directory "latex/preview"
3852        #:phases
3853        (modify-phases %standard-phases
3854          (add-after 'unpack 'remove-generated-file
3855            (lambda _
3856              (delete-file "preview.drv")
3857              #t)))))
3858     (home-page "https://www.ctan.org/pkg/preview")
3859     (synopsis "Extract bits of a LaTeX source for output")
3860     (description
3861      "The main purpose of the preview package is the extraction of selected
3862 elements from a LaTeX source, like formulas or graphics, into separate
3863 pages of a DVI file.  A flexible and convenient interface allows it to
3864 specify what commands and constructs should be extracted.  This works
3865 with DVI files postprocessed by either Dvips and Ghostscript or
3866 dvipng, but it also works when you are using PDFTeX for generating PDF
3867 files.")
3868     (license license:gpl3+)))
3870 (define-public texlive-latex-acronym
3871   (package
3872     (name "texlive-latex-acronym")
3873     (version (number->string %texlive-revision))
3874     (source (origin
3875               (method svn-fetch)
3876               (uri (texlive-ref "latex" "acronym"))
3877               (file-name (string-append name "-" version "-checkout"))
3878               (sha256
3879                (base32
3880                 "0jmasg40bk53zdd2jc8nc18jvdai3p2wmamy7hwli8gls4nf25qp"))))
3881     (build-system texlive-build-system)
3882     (arguments '(#:tex-directory "latex/acronym"))
3883     (home-page "https://www.ctan.org/pkg/acronym")
3884     (synopsis "Expand acronyms at least once")
3885     (description
3886      "This package ensures that all acronyms used in the text are spelled out
3887 in full at least once.  It also provides an environment to build a list of
3888 acronyms used.  The package is compatible with PDF bookmarks.  The package
3889 requires the suffix package, which in turn requires that it runs under
3890 e-TeX.")
3891     (license license:lppl1.3+)))
3893 (define-public texlive-generic-pdftex
3894   (package
3895     (name "texlive-generic-pdftex")
3896     (version (number->string %texlive-revision))
3897     (source (origin
3898               (method svn-fetch)
3899               (uri (svn-reference
3900                     (url (string-append "svn://www.tug.org/texlive/tags/"
3901                                         %texlive-tag "/Master/texmf-dist/"
3902                                         "/tex/generic/pdftex"))
3903                     (revision %texlive-revision)))
3904               (file-name (string-append name "-" version "-checkout"))
3905               (sha256
3906                (base32
3907                 "0k68zmqzs4qvrqxdwsrawbjb14hxqjfamq649azvai0jjxdpkljd"))))
3908     (build-system trivial-build-system)
3909     (arguments
3910      `(#:modules ((guix build utils))
3911        #:builder
3912        (begin
3913          (use-modules (guix build utils))
3914          (let ((target (string-append (assoc-ref %outputs "out")
3915                                       "/share/texmf-dist/tex/generic/pdftex")))
3916            (mkdir-p target)
3917            (copy-recursively (assoc-ref %build-inputs "source") target)
3918            #t))))
3919     (home-page "https://www.ctan.org/pkg/pdftex")
3920     (synopsis "TeX extension for direct creation of PDF")
3921     (description
3922      "This package provides an extension of TeX which can be configured to
3923 directly generate PDF documents instead of DVI.")
3924     (license license:gpl2+)))
3926 (define texlive-texmf
3927   (package
3928    (name "texlive-texmf")
3929    (version "2017")
3930    (source texlive-texmf-src)
3931    (build-system gnu-build-system)
3932    (inputs
3933     `(("texlive-bin" ,texlive-bin)
3934       ("lua" ,lua)
3935       ("perl" ,perl)
3936       ("python" ,python-2) ; incompatible with Python 3 (print syntax)
3937       ("ruby" ,ruby)
3938       ("tcsh" ,tcsh)))
3939    (arguments
3940     `(#:modules ((guix build gnu-build-system)
3941                  (guix build utils)
3942                  (srfi srfi-26))
3944       ;; This package takes 4 GiB, which we can't afford to distribute from
3945       ;; our servers.
3946       #:substitutable? #f
3948       #:phases
3949         (modify-phases (map (cut assq <> %standard-phases)
3950                             '(set-paths unpack patch-source-shebangs))
3951           (add-after 'patch-source-shebangs 'install
3952             (lambda* (#:key outputs #:allow-other-keys)
3953               (let ((share (string-append (assoc-ref outputs "out") "/share")))
3954                 (mkdir-p share)
3955                 (invoke "mv" "texmf-dist" share))))
3956           (add-after 'install 'texmf-config
3957             (lambda* (#:key inputs outputs #:allow-other-keys)
3958               (let* ((out (assoc-ref outputs "out"))
3959                      (share (string-append out "/share"))
3960                      (texmfroot (string-append share "/texmf-dist/web2c"))
3961                      (texmfcnf (string-append texmfroot "/texmf.cnf"))
3962                      (texlive-bin (assoc-ref inputs "texlive-bin"))
3963                      (texbin (string-append texlive-bin "/bin"))
3964                      (tlpkg (string-append texlive-bin "/share/tlpkg")))
3965                 ;; Register SHARE as TEXMFROOT in texmf.cnf.
3966                 (substitute* texmfcnf
3967                   (("TEXMFROOT = \\$SELFAUTOPARENT")
3968                    (string-append "TEXMFROOT = " share))
3969                   (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
3970                    "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
3971                   (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
3972                 ;; Register paths in texmfcnf.lua, needed for context.
3973                 (substitute* (string-append texmfroot "/texmfcnf.lua")
3974                   (("selfautodir:") out)
3975                   (("selfautoparent:") (string-append share "/")))
3976                 ;; Set path to TeXLive Perl modules
3977                 (setenv "PERL5LIB"
3978                         (string-append (getenv "PERL5LIB") ":" tlpkg))
3979                 ;; Configure the texmf-dist tree; inspired from
3980                 ;; http://slackbuilds.org/repository/13.37/office/texlive/
3981                 (setenv "PATH" (string-append (getenv "PATH") ":" texbin))
3982                 (setenv "TEXMFCNF" texmfroot)
3983                 (invoke "updmap-sys" "--nohash" "--syncwithtrees")
3984                 (invoke "mktexlsr")
3985                 (invoke "fmtutil-sys" "--all")))))))
3986    (properties `((max-silent-time . 9600))) ; don't time out while grafting
3987    (synopsis "TeX Live, a package of the TeX typesetting system")
3988    (description
3989     "TeX Live provides a comprehensive TeX document production system.
3990 It includes all the major TeX-related programs, macro packages, and fonts
3991 that are free software, including support for many languages around the
3992 world.
3994 This package contains the complete tree of texmf-dist data.")
3995    (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
3996    (home-page "https://www.tug.org/texlive/")))
3998 (define-public texlive
3999   (package
4000    (name "texlive")
4001    (version "2017")
4002    (source #f)
4003    (build-system trivial-build-system)
4004    (inputs `(("bash" ,bash) ; for wrap-program
4005              ("texlive-bin" ,texlive-bin)
4006              ("texlive-texmf" ,texlive-texmf)))
4007    (native-search-paths
4008     (list (search-path-specification
4009            (variable "TEXMFLOCAL")
4010            (files '("share/texmf-local")))))
4011    (arguments
4012     `(#:modules ((guix build utils))
4013       #:builder
4014         ;; Build the union of texlive-bin and texlive-texmf, but take the
4015         ;; conflicting subdirectory share/texmf-dist from texlive-texmf.
4016         (begin
4017           (use-modules (guix build utils))
4018           (let ((out (assoc-ref %outputs "out"))
4019                 (bin (assoc-ref %build-inputs "texlive-bin"))
4020                 (texmf (assoc-ref %build-inputs "texlive-texmf"))
4021                 (bash (assoc-ref %build-inputs "bash")))
4022                (mkdir out)
4023                (with-directory-excursion out
4024                  (for-each
4025                    (lambda (name)
4026                      (symlink (string-append bin "/" name) name))
4027                    '("include" "lib"))
4028                  (mkdir "bin")
4029                  (with-directory-excursion "bin"
4030                    (setenv "PATH" (string-append bash "/bin"))
4031                    (for-each
4032                      (lambda (name)
4033                        (symlink name (basename name))
4034                        (wrap-program
4035                          (basename name)
4036                          `("TEXMFCNF" =
4037                            (,(string-append texmf "/share/texmf-dist/web2c")))))
4038                      (find-files (string-append bin "/bin/") "")))
4039                  (mkdir "share")
4040                  (with-directory-excursion "share"
4041                    (for-each
4042                      (lambda (name)
4043                        (symlink (string-append bin "/share/" name) name))
4044                      '("info" "man" "tlpkg"))
4045                    (for-each
4046                      (lambda (name)
4047                        (symlink (string-append texmf "/share/" name) name))
4048                      '("texmf-dist" "texmf-var"))))
4049                #t))))
4050    (synopsis "TeX Live, a package of the TeX typesetting system")
4051    (description
4052     "TeX Live provides a comprehensive TeX document production system.
4053 It includes all the major TeX-related programs, macro packages, and fonts
4054 that are free software, including support for many languages around the
4055 world.
4057 This package contains the complete TeX Live distribution.")
4058    (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
4059    (home-page "https://www.tug.org/texlive/")))
4061 (define-public perl-text-bibtex
4062   (package
4063     (name "perl-text-bibtex")
4064     (version "0.85")
4065     (source
4066      (origin
4067        (method url-fetch)
4068        (uri (string-append "mirror://cpan/authors/id/A/AM/AMBS/Text-BibTeX-"
4069                            version ".tar.gz"))
4070        (sha256
4071         (base32
4072          "036kxgbn1jf70pfm2lmjlzjwnhbkd888fp5lyvmkjpdd15gla18h"))))
4073     (build-system perl-build-system)
4074     (arguments
4075      `(#:phases
4076        (modify-phases %standard-phases
4077          (add-after 'unpack 'add-output-directory-to-rpath
4078            (lambda* (#:key outputs #:allow-other-keys)
4079              (substitute* "inc/MyBuilder.pm"
4080                (("-Lbtparse" line)
4081                 (string-append "-Wl,-rpath="
4082                                (assoc-ref outputs "out") "/lib " line)))
4083              #t))
4084          (add-after 'unpack 'install-libraries-to-/lib
4085            (lambda* (#:key outputs #:allow-other-keys)
4086              (substitute* "Build.PL"
4087                (("lib64") "lib"))
4088              #t)))))
4089     (native-inputs
4090      `(("perl-capture-tiny" ,perl-capture-tiny)
4091        ("perl-config-autoconf" ,perl-config-autoconf)
4092        ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
4093        ("perl-module-build" ,perl-module-build)))
4094     (home-page "http://search.cpan.org/dist/Text-BibTeX")
4095     (synopsis "Interface to read and parse BibTeX files")
4096     (description "@code{Text::BibTeX} is a Perl library for reading, parsing,
4097 and processing BibTeX files.  @code{Text::BibTeX} gives you access to the data
4098 at many different levels: you may work with BibTeX entries as simple field to
4099 string mappings, or get at the original form of the data as a list of simple
4100 values (strings, macros, or numbers) pasted together.")
4101     (license license:perl-license)))
4103 (define-public biber
4104   (package
4105     (name "biber")
4106     (version "2.7")
4107     (source (origin
4108               (method url-fetch)
4109               (uri (string-append "https://github.com/plk/biber/archive/v"
4110                                   version ".tar.gz"))
4111               (file-name (string-append name "-" version ".tar.gz"))
4112               (sha256
4113                (base32
4114                 "17wd80jg98qyddhvz4cin8779ycvppaf2va77r1lyvymjz6w9bx0"))))
4115     (build-system perl-build-system)
4116     (arguments
4117      `(#:phases
4118        (modify-phases %standard-phases
4119          (add-after 'install 'wrap-programs
4120            (lambda* (#:key outputs #:allow-other-keys)
4121              (let* ((out (assoc-ref outputs "out"))
4122                     (perl5lib (getenv "PERL5LIB")))
4123                (wrap-program (string-append out "/bin/biber")
4124                  `("PERL5LIB" ":" prefix
4125                    (,(string-append perl5lib ":" out
4126                                     "/lib/perl5/site_perl")))))
4127              #t)))))
4128     (inputs
4129      `(("perl-autovivification" ,perl-autovivification)
4130        ("perl-class-accessor" ,perl-class-accessor)
4131        ("perl-data-dump" ,perl-data-dump)
4132        ("perl-data-compare" ,perl-data-compare)
4133        ("perl-data-uniqid" ,perl-data-uniqid)
4134        ("perl-datetime-format-builder" ,perl-datetime-format-builder)
4135        ("perl-datetime-calendar-julian" ,perl-datetime-calendar-julian)
4136        ("perl-file-slurp" ,perl-file-slurp)
4137        ("perl-ipc-cmd" ,perl-ipc-cmd)
4138        ("perl-ipc-run3" ,perl-ipc-run3)
4139        ("perl-list-allutils" ,perl-list-allutils)
4140        ("perl-list-moreutils" ,perl-list-moreutils)
4141        ("perl-mozilla-ca" ,perl-mozilla-ca)
4142        ("perl-regexp-common" ,perl-regexp-common)
4143        ("perl-log-log4perl" ,perl-log-log4perl)
4144        ;; We cannot use perl-unicode-collate here, because otherwise the
4145        ;; hardcoded hashes in the tests would differ.  See
4146        ;; https://mail-archive.com/debian-bugs-dist@lists.debian.org/msg1469249.html
4147        ;;("perl-unicode-collate" ,perl-unicode-collate)
4148        ("perl-unicode-normalize" ,perl-unicode-normalize)
4149        ("perl-unicode-linebreak" ,perl-unicode-linebreak)
4150        ("perl-encode-eucjpascii" ,perl-encode-eucjpascii)
4151        ("perl-encode-jis2k" ,perl-encode-jis2k)
4152        ("perl-encode-hanextra" ,perl-encode-hanextra)
4153        ("perl-xml-libxml" ,perl-xml-libxml)
4154        ("perl-xml-libxml-simple" ,perl-xml-libxml-simple)
4155        ("perl-xml-libxslt" ,perl-xml-libxslt)
4156        ("perl-xml-writer" ,perl-xml-writer)
4157        ("perl-sort-key" ,perl-sort-key)
4158        ("perl-text-csv" ,perl-text-csv)
4159        ("perl-text-csv-xs" ,perl-text-csv-xs)
4160        ("perl-text-roman" ,perl-text-roman)
4161        ("perl-uri" ,perl-uri)
4162        ("perl-text-bibtex" ,perl-text-bibtex)
4163        ("perl-libwww" ,perl-libwww)
4164        ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
4165        ("perl-business-isbn" ,perl-business-isbn)
4166        ("perl-business-issn" ,perl-business-issn)
4167        ("perl-business-ismn" ,perl-business-ismn)
4168        ("perl-lingua-translit" ,perl-lingua-translit)))
4169     (native-inputs
4170      `(("perl-config-autoconf" ,perl-config-autoconf)
4171        ("perl-extutils-libbuilder" ,perl-extutils-libbuilder)
4172        ("perl-module-build" ,perl-module-build)
4173        ;; for tests
4174        ("perl-file-which" ,perl-file-which)
4175        ("perl-test-more" ,perl-test-most) ; FIXME: "more" would be sufficient
4176        ("perl-test-differences" ,perl-test-differences)))
4177     (home-page "http://biblatex-biber.sourceforge.net/")
4178     (synopsis "Backend for the BibLaTeX citation management tool")
4179     (description "Biber is a BibTeX replacement for users of biblatex.  Among
4180 other things it comes with full Unicode support.")
4181     (license license:artistic2.0)))
4183 (define-public rubber
4184   (package
4185     (name "rubber")
4186     (version "1.1")
4187     (source (origin
4188              (method url-fetch)
4189              (uri (list (string-append "https://launchpad.net/rubber/trunk/"
4190                                        version "/+download/rubber-"
4191                                        version ".tar.gz")
4192                         (string-append "http://ebeffara.free.fr/pub/rubber-"
4193                                        version ".tar.gz")))
4194              (sha256
4195               (base32
4196                "1xbkv8ll889933gyi2a5hj7hhh216k04gn8fwz5lfv5iz8s34gbq"))))
4197     (build-system gnu-build-system)
4198     (arguments '(#:tests? #f))                    ; no `check' target
4199     (inputs `(("texinfo" ,texinfo)
4200               ("python" ,python-2) ; incompatible with Python 3 (print syntax)
4201               ("which" ,which)))
4202     (home-page "https://launchpad.net/rubber")
4203     (synopsis "Wrapper for LaTeX and friends")
4204     (description
4205      "Rubber is a program whose purpose is to handle all tasks related to the
4206 compilation of LaTeX documents.  This includes compiling the document itself,
4207 of course, enough times so that all references are defined, and running BibTeX
4208 to manage bibliographic references.  Automatic execution of dvips to produce
4209 PostScript documents is also included, as well as usage of pdfLaTeX to produce
4210 PDF documents.")
4211     (license license:gpl2+)))
4213 (define-public texmaker
4214   (package
4215     (name "texmaker")
4216     (version "4.5")
4217     (source (origin
4218               (method url-fetch)
4219               (uri (string-append "http://www.xm1math.net/texmaker/texmaker-"
4220                                   version ".tar.bz2"))
4221               (sha256
4222                (base32
4223                 "056njk6j8wma23mlp7xa3rgfaxx0q8ynwx8wkmj7iy0b85p9ds9c"))))
4224     (build-system gnu-build-system)
4225     (arguments
4226      `(#:phases
4227        (modify-phases %standard-phases
4228          ;; Qt has its own configuration utility.
4229          (replace 'configure
4230            (lambda* (#:key outputs #:allow-other-keys)
4231              (let ((out (assoc-ref outputs "out")))
4232                (invoke "qmake"
4233                        (string-append "PREFIX=" out)
4234                        (string-append "DESKTOPDIR=" out
4235                                       "/share/applications")
4236                        (string-append "ICONDIR=" out "/share/pixmaps")
4237                        "texmaker.pro")))))))
4238     (inputs
4239      `(("poppler-qt5" ,poppler-qt5)
4240        ("qtbase" ,qtbase)
4241        ("qtscript" ,qtscript)
4242        ("qtwebkit" ,qtwebkit)
4243        ("zlib" ,zlib)))
4244     (native-inputs
4245      `(("pkg-config" ,pkg-config)))
4246     (home-page "http://www.xm1math.net/texmaker/")
4247     (synopsis "LaTeX editor")
4248     (description "Texmaker is a program that integrates many tools needed to
4249 develop documents with LaTeX, in a single application.")
4250     (license license:gpl2+)))
4253 (define-public teximpatient
4254   (package
4255     (name "teximpatient")
4256     (version "2.4")
4257     (source (origin
4258               (method url-fetch)
4259               (uri (string-append "mirror://gnu/" name "/" name "-"
4260                                   version ".tar.gz"))
4261               (sha256
4262                (base32
4263                 "0h56w22d99dh4fgld4ssik8ggnmhmrrbnrn1lnxi1zr0miphn1sd"))))
4264     (build-system gnu-build-system)
4265     (arguments
4266      `(#:phases
4267        (modify-phases %standard-phases
4268          (delete 'check)
4269          ;; Unfortunately some mistakes have been made in packaging.
4270          ;; Work around them here ...
4271          (replace 'unpack
4272            (lambda* (#:key inputs outputs #:allow-other-keys)
4273              (let ((srcdir "teximpatient-2.4"))
4274                (system* "tar" "-xzf" (assoc-ref inputs "source")
4275                         (string-append "--one-top-level=" srcdir))
4276                (delete-file (string-append srcdir "/book.pdf"))
4277                (install-file (car
4278                               (find-files
4279                                (assoc-ref inputs "automake")
4280                                "^install-sh$"))
4281                              srcdir)
4282                (chdir srcdir)))))))
4283     (native-inputs
4284      `(("texlive" ,texlive)
4285        ("automake" ,automake)))
4286     (home-page "https://www.gnu.org/software/teximpatient/")
4287     (synopsis "Book on TeX, plain TeX and Eplain")
4288     (description "@i{TeX for the Impatient} is a ~350 page book on TeX,
4289 plain TeX, and Eplain, originally written by Paul Abrahams, Kathryn Hargreaves,
4290 and Karl Berry.")
4291     (license license:fdl1.3+)))
4293 (define-public lyx
4294   (package
4295     (name "lyx")
4296     (version "2.2.3")
4297     (source (origin
4298              (method url-fetch)
4299              (uri (string-append "http://ftp.lyx.org/pub/lyx/stable/2.2.x/"
4300                                  name "-" version ".tar.gz"))
4301              (sha256
4302               (base32
4303                "0xvaz0i371nn2ndinc0d3ywj76ivb62649a4sdgwbivisiahd2fj"))
4304              (patches (search-patches "lyx-2.2.3-fix-test.patch"))
4305              (modules '((guix build utils)))
4306              (snippet
4307               '(begin
4308                 (delete-file-recursively "3rdparty")
4309                 #t))))
4310     (build-system cmake-build-system)
4311     (arguments
4312      `(#:configure-flags `("-DLYX_USE_QT=QT5"
4313                            "-DLYX_EXTERNAL_BOOST=1"
4314                            "-DLYX_INSTALL=1"
4315                            "-DLYX_RELEASE=1"
4316                            ,(string-append "-DLYX_INSTALL_PREFIX="
4317                                            (assoc-ref %outputs "out")
4318                                            ;; Exact name and level is necessary.
4319                                            "/lyx2.2"))
4320        #:phases
4321        (modify-phases %standard-phases
4322          (add-after 'unpack 'patch-python
4323            (lambda* (#:key inputs #:allow-other-keys)
4324              (substitute* '("src/support/os.cpp")
4325               (("\"python ")
4326                (string-append "\""
4327                               (assoc-ref inputs "python-2")
4328                               "/bin/python ")))
4329              #t))
4330          (add-after 'patch-python 'patch-installer
4331            (lambda* (#:key outputs #:allow-other-keys)
4332              (substitute* "CMakeLists.txt"
4333               (("/usr/local/man/man1")
4334                (string-append (assoc-ref outputs "out")
4335                               "/share/man/man1")))
4336              #t))
4337          (add-after 'patch-python 'patch-desktop-file
4338            (lambda* (#:key outputs #:allow-other-keys)
4339              (substitute* "lib/lyx.desktop.in"
4340               (("Exec=")
4341                (string-append "Exec="
4342                               (assoc-ref outputs "out")
4343                               "/")))
4344              #t))
4345          (add-before 'check 'setenv-check
4346            (lambda _
4347              (setenv "LYX_DIR_22x" (string-append (getcwd) "/../lyx-"
4348                                                   ,version "/lib"))
4349              #t))
4350          (add-after 'install 'install-symlinks
4351            (lambda* (#:key outputs #:allow-other-keys)
4352              (let ((out (assoc-ref outputs "out")))
4353                (mkdir-p (string-append out "/bin"))
4354                (symlink "../lyx2.2/bin/lyx2.2"
4355                 (string-append out "/bin/lyx2.2"))
4356                #t))))))
4357     (inputs
4358      `(("boost" ,boost)
4359        ("hunspell" ,hunspell) ; Note: Could also use aspell instead.
4360        ("libx11" ,libx11)
4361        ("python-2" ,python-2)
4362        ("qtbase" ,qtbase)
4363        ("qtsvg" ,qtsvg)
4364        ("zlib" ,zlib)))
4365     (propagated-inputs
4366      `(("texlive" ,texlive))) ; article.cls is in texmf-dist.
4367     (native-inputs
4368      `(("python-2" ,python-2)
4369        ("pkg-config" ,pkg-config)
4370        ("bc" ,bc)))
4371     (home-page "https://www.lyx.org/")
4372     (synopsis "Document preparation system with GUI")
4373     (description "LyX is a document preparation system.  It excels at letting
4374 you create complex technical and scientific articles with mathematics,
4375 cross-references, bibliographies, indexes, etc.  It is very good for working
4376 with documents of any length in which the usual processing abilities are
4377 required: automatic sectioning and pagination, spell checking and so forth.")
4378     (license license:gpl2+)))