tex.scm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. (define-module (tex)
  2. #:use-module ((guix licenses) #:prefix license:)
  3. #:use-module (guix packages)
  4. #:use-module (gnu packages tex)
  5. #:use-module (gnu packages perl)
  6. #:use-module (guix build-system texlive)
  7. #:use-module (guix build-system gnu)
  8. #:use-module (guix build-system trivial)
  9. #:use-module (guix svn-download)
  10. #:use-module (ice-9 ftw)
  11. #:use-module (ice-9 match)
  12. #:use-module ((srfi srfi-1) #:hide (zip)))
  13. (define-public texlive-generic-ulem
  14. (package
  15. (name "texlive-generic-ulem")
  16. (version (number->string %texlive-revision))
  17. (source
  18. (origin
  19. (method svn-fetch)
  20. (uri (svn-reference
  21. (url (string-append "svn://www.tug.org/texlive/tags/"
  22. %texlive-tag "/Master/texmf-dist/"
  23. "/tex/generic/ulem"))
  24. (revision %texlive-revision)))
  25. (file-name (string-append name "-" version "-checkout"))
  26. (sha256
  27. (base32
  28. "1rzdniqq9zk39w8ch8ylx3ywh2mj87s4ivchrsk2b8nx06jyn797"))))
  29. (build-system trivial-build-system)
  30. (arguments
  31. `(#:modules ((guix build utils))
  32. #:builder
  33. (begin
  34. (use-modules (guix build utils))
  35. (let ((target (string-append (assoc-ref %outputs "out")
  36. "/share/texmf-dist/tex/generic/ulem")))
  37. (mkdir-p target)
  38. (copy-recursively (assoc-ref %build-inputs "source") target)
  39. #t))))
  40. (home-page "https://www.ctan.org/pkg/ulem")
  41. (synopsis "Underline text")
  42. (description
  43. "The package provides an @code{\\ul} (underline) command which will break
  44. over line ends; this technique may be used to replace @code{\\em} (both in that
  45. form and as the @code{\\emph} command), so as to make output look as if it comes
  46. from a typewriter. The package also offers double and wavy underlining, and
  47. striking out (line through words) and crossing out (/// over words).")
  48. ;; TODO: Check if this is the proper license.
  49. (license license:lppl1.3c+)))
  50. (define-public texlive-latex-pgf
  51. (package
  52. (name "texlive-latex-pgf")
  53. (version (number->string %texlive-revision))
  54. (source
  55. (origin
  56. (method svn-fetch)
  57. (uri (svn-reference
  58. (url (string-append "svn://www.tug.org/texlive/tags/"
  59. %texlive-tag "/Master/texmf-dist/"
  60. "/tex/latex/pgf"))
  61. (revision %texlive-revision)))
  62. (file-name (string-append name "-" version "-checkout"))
  63. (sha256
  64. (base32
  65. "1dq8p10pz8wn0vx412m7d7d5gj1syxly3yqdqvf7lv2xl8zndn5h"))))
  66. (build-system trivial-build-system)
  67. (arguments
  68. `(#:modules ((guix build utils))
  69. #:builder
  70. (begin
  71. (use-modules (guix build utils))
  72. (let ((target (string-append (assoc-ref %outputs "out")
  73. "/share/texmf-dist/tex/latex/pgf")))
  74. (mkdir-p target)
  75. (copy-recursively (assoc-ref %build-inputs "source") target)
  76. #t))))
  77. (home-page "https://www.ctan.org/pkg/tikz")
  78. (synopsis "Create PostScript and PDF graphics in TeX")
  79. (description
  80. "PGF is a macro package for creating graphics. It is platform- and
  81. format-independent and works together with the most important TeX backend
  82. drivers, including pdfTeX and dvips. It comes with a user-friendly syntax layer
  83. called TikZ.
  84. Its usage is similar to pstricks and the standard picture environment. PGF works
  85. with plain (pdf-)TeX, (pdf-)LaTeX, and ConTeXt. Unlike pstricks, it can produce
  86. either PostScript or PDF output.")
  87. (license license:lppl1.3c+)))
  88. ;; TODO: Koma-script does not build.
  89. ;; Try pre-built file https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=koma-script.
  90. (define-public texlive-latex-koma-script
  91. (package
  92. (name "texlive-latex-koma-script")
  93. (version (number->string %texlive-revision))
  94. (source (origin
  95. (method svn-fetch)
  96. (uri (texlive-ref "latex" "koma-script"))
  97. (file-name (string-append name "-" version "-checkout"))
  98. (sha256
  99. (base32
  100. "0nn0nr437f5rasmb48iq2h2gvmvpafkayihx7wvxkfh7rrr8ils4"))))
  101. (build-system gnu-build-system)
  102. (native-inputs
  103. `(("texlive-bin" ,texlive-bin)
  104. ("perl" ,perl)
  105. ;; ("texlive-metafont-base" ,texlive-metafont-base)
  106. ;; ("texlive-fonts-cm" ,texlive-fonts-cm)
  107. ))
  108. ;; (arguments
  109. ;; `(#:modules ((guix build utils))
  110. ;; #:builder
  111. ;; (begin
  112. ;; (use-modules (guix build utils))
  113. ;; (let ((target (string-append (assoc-ref %outputs "out")
  114. ;; "/share/texmf-dist/tex/latex/eukdate")))
  115. ;; (mkdir-p target)
  116. ;; (copy-recursively (assoc-ref %build-inputs "source") target)
  117. ;; #t))))
  118. (arguments
  119. `(#:phases
  120. (modify-phases %standard-phases
  121. ;; TODO: Need to set PATH variable in Makefile.baseinit.
  122. (delete 'configure))))
  123. (inputs
  124. `(("texlive-latex-filecontents" ,texlive-latex-filecontents)
  125. ("texlive-latex-babel" ,texlive-latex-babel)))
  126. (home-page "https://www.ctan.org/pkg/koma-script")
  127. (synopsis "Bundle of versatile classes and packages")
  128. (description
  129. "The KOMA-Script bundle provides replacements for the article, report, and
  130. book classes with emphasis on typography and versatility. There is also a
  131. letter class.
  132. The bundle also offers:
  133. @itemize
  134. @item a package for calculating type areas in the way laid down by the
  135. typographer Jan Tschichold,
  136. @item packages for easily changing and defining page styles,
  137. @item a package scrdate for getting not only the current date but also the name
  138. of the day, and
  139. @item a package scrtime for getting the current time.
  140. @end itemize
  141. All these packages may be used not only with KOMA-Script classes but also with
  142. the standard classes.
  143. Since every package has its own version number, the version number quoted only
  144. refers to the version of scrbook, scrreprt, scrartcl, scrlttr2 and
  145. typearea (which are the main parts of the bundle).")
  146. (license license:lppl1.3+)))
  147. ;; TODO: Marvosym fonts build but they can't be used properly.
  148. ;; http://www.tug.org/svn/texlive/tags/texlive-2017.1/Master/texmf-dist/source/fonts/marvosym/
  149. ;; https://github.com/mojca/marvosym
  150. ;; TODO: Check out texlive-fonts-ec, we need to patch some PATHS.
  151. (define-public texlive-fonts-marvosym
  152. (package
  153. (name "texlive-fonts-marvosym")
  154. (version (number->string %texlive-revision))
  155. (source (origin
  156. (method svn-fetch)
  157. (uri (svn-reference
  158. (url (string-append "svn://www.tug.org/texlive/tags/"
  159. %texlive-tag "/Master/texmf-dist/"
  160. "/tex/latex/marvosym"))
  161. (revision %texlive-revision)))
  162. (file-name (string-append name "-" version "-checkout"))
  163. (sha256
  164. (base32
  165. "0qhrccc340ipmq93jh8dmpai81dk46wi34impd6lrzx72fi17s7g"))))
  166. (build-system trivial-build-system)
  167. (arguments
  168. `(#:modules ((guix build utils)
  169. (ice-9 match))
  170. #:builder
  171. (begin
  172. (use-modules (guix build utils)
  173. (ice-9 match))
  174. (let ((root (string-append (assoc-ref %outputs "out")
  175. "/share/texmf-dist/"))
  176. (pkgs '(("source" . "tex/latex/marvosym")
  177. ("marvosym-truetype" . "fonts/truetype/public/marvosym")
  178. ("marvosym-afm" . "fonts/afm/public/marvosym")
  179. ("marvosym-tfm" . "fonts/tfm/public/marvosym")
  180. ("marvosym-type1" . "fonts/type1/public/marvosym")
  181. ;; ("marvosym-enc" . "fonts/enc/dvips/marvosym")
  182. ("marvosym-map" . "fonts/map/dvips/marvosym"))))
  183. (for-each (match-lambda
  184. ((pkg . dir)
  185. (let ((target (string-append root dir)))
  186. (mkdir-p target)
  187. (copy-recursively (assoc-ref %build-inputs pkg)
  188. target))))
  189. pkgs)
  190. #t))))
  191. (native-inputs
  192. `(("marvosym-tfm"
  193. ,(origin
  194. (method svn-fetch)
  195. (uri (svn-reference
  196. (url (string-append "svn://www.tug.org/texlive/tags/"
  197. %texlive-tag "/Master/texmf-dist/"
  198. "/fonts/tfm/public/marvosym"))
  199. (revision %texlive-revision)))
  200. (file-name (string-append name "-tfm-" version "-checkout"))
  201. (sha256
  202. (base32
  203. "1912j5p59baij47cr793jsjsp465077g990iif6vm6bgg7ha8b2v"))))
  204. ("marvosym-afm"
  205. ,(origin
  206. (method svn-fetch)
  207. (uri (svn-reference
  208. (url (string-append "svn://www.tug.org/texlive/tags/"
  209. %texlive-tag "/Master/texmf-dist/"
  210. "/fonts/afm/public/marvosym"))
  211. (revision %texlive-revision)))
  212. (file-name (string-append name "-afm-" version "-checkout"))
  213. (sha256
  214. (base32
  215. "09jb393ivgnk4brx8jgll5dpfx2hqb2h94i94lqv30snbnhw93k8"))))
  216. ("marvosym-type1"
  217. ,(origin
  218. (method svn-fetch)
  219. (uri (svn-reference
  220. (url (string-append "svn://www.tug.org/texlive/tags/"
  221. %texlive-tag "/Master/texmf-dist/"
  222. "/fonts/type1/public/marvosym"))
  223. (revision %texlive-revision)))
  224. (file-name (string-append name "-type1-" version "-checkout"))
  225. (sha256
  226. (base32
  227. "19kri8lf2z6j3b74iczppj01j28m3v2qbwq9507nxswfjxxlmb22"))))
  228. ("marvosym-truetype"
  229. ,(origin
  230. (method svn-fetch)
  231. (uri (svn-reference
  232. (url (string-append "svn://www.tug.org/texlive/tags/"
  233. %texlive-tag "/Master/texmf-dist/"
  234. "/fonts/truetype/public/marvosym"))
  235. (revision %texlive-revision)))
  236. (file-name (string-append name "-truetype-" version "-checkout"))
  237. (sha256
  238. (base32
  239. "1x4yrpwwjfvhfvcby9w4dv0kdsgz0ic0c0i5zg1h692grvc0rzar"))))
  240. ("marvosym-map"
  241. ,(origin
  242. (method svn-fetch)
  243. (uri (svn-reference
  244. (url (string-append "svn://www.tug.org/texlive/tags/"
  245. %texlive-tag "/Master/texmf-dist/"
  246. "/fonts/map/dvips/marvosym"))
  247. (revision %texlive-revision)))
  248. (file-name (string-append name "-map-" version "-checkout"))
  249. (sha256
  250. (base32
  251. "1ybwqpwmr79ma9sf0c7apyadhldzsxbwbqgnracaiy810mjzychf"))))))
  252. (home-page "https://www.ctan.org/pkg/threeparttable")
  253. (synopsis "Martin Vogel's Symbols (marvosym) font")
  254. (description
  255. "Martin Vogel’s Symbol font (marvosym) contains the Euro currency symbol as
  256. ;; defined by the European commission, along with symbols for structural
  257. ;; engineering; symbols for steel cross-sections; astronomy signs (sun, moon,
  258. ;; planets); the 12 signs of the zodiac; scissor symbols; CE sign and others.
  259. ;; The package contains both the original TrueType font and the derived Type 1
  260. ;; font, together with support files for TeX (LaTeX).")
  261. ;; TODO: Fix license.
  262. (license license:gpl3+)))
  263. (define-public texlive-latex-eukdate
  264. (package
  265. (name "texlive-latex-eukdate")
  266. (version (number->string %texlive-revision))
  267. (source
  268. (origin
  269. (method svn-fetch)
  270. (uri (svn-reference
  271. (url (string-append "svn://www.tug.org/texlive/tags/"
  272. %texlive-tag "/Master/texmf-dist/"
  273. "/tex/latex/eukdate"))
  274. (revision %texlive-revision)))
  275. (file-name (string-append name "-" version "-checkout"))
  276. (sha256
  277. (base32
  278. "18xan116l8w47v560bkw6nbhkrml7g04xrlzk3jrpc7qsyf3n5fz"))))
  279. (build-system trivial-build-system)
  280. (arguments
  281. `(#:modules ((guix build utils))
  282. #:builder
  283. (begin
  284. (use-modules (guix build utils))
  285. (let ((target (string-append (assoc-ref %outputs "out")
  286. "/share/texmf-dist/tex/latex/eukdate")))
  287. (mkdir-p target)
  288. (copy-recursively (assoc-ref %build-inputs "source") target)
  289. #t))))
  290. (home-page "https://www.ctan.org/pkg/eukdate")
  291. (synopsis "UK format dates, with weekday")
  292. (description
  293. "The package is used to change the format of @code{\\today}’s date,
  294. including the weekday, e.g., \"Saturday, 26 June 2008\", the 'UK format', which
  295. is preferred in many parts of the world, as distinct from that which is used in
  296. @code{\\maketitle} of the article class, \"June 26, 2008\", the 'US format'.")
  297. (license license:lppl1.3c+)))
  298. (define-public texlive-latex-needspace
  299. (package
  300. (name "texlive-latex-needspace")
  301. (version (number->string %texlive-revision))
  302. (source (origin
  303. (method svn-fetch)
  304. (uri (texlive-ref "latex" "needspace"))
  305. (file-name (string-append name "-" version "-checkout"))
  306. (sha256
  307. (base32
  308. "0kw80f5jh4gdpa2ka815abza3gr5z8b929w0745vrlc59pl0017y"))))
  309. (build-system texlive-build-system)
  310. (arguments
  311. '(#:tex-directory "latex/needspace"
  312. #:tex-format "latex"))
  313. (inputs
  314. `(("texlive-latex-filecontents" ,texlive-latex-filecontents)))
  315. ;; (build-system trivial-build-system)
  316. ;; (arguments
  317. ;; `(#:modules ((guix build utils))
  318. ;; #:builder
  319. ;; (begin
  320. ;; (use-modules (guix build utils))
  321. ;; (let ((target (string-append (assoc-ref %outputs "out")
  322. ;; "/share/texmf-dist/tex/latex/needspace")))
  323. ;; (mkdir-p target)
  324. ;; (copy-recursively (assoc-ref %build-inputs "source") target)
  325. ;; #t))))
  326. (home-page "https://www.ctan.org/pkg/needspace")
  327. (synopsis "Insert pagebreak if not enough space")
  328. (description
  329. "Provides commands to disable pagebreaking within a given vertical
  330. space. If there is not enough space between the command and the bottom of the
  331. page, a new page will be started.")
  332. ;; TODO: Check if this is the proper license.
  333. (license license:lppl1.3c+)))
  334. ;; TODO: Do I need microtype?
  335. ;; (define-public texlive-latex-microtype
  336. ;; (package
  337. ;; (name "texlive-latex-microtype")
  338. ;; (version (number->string %texlive-revision))
  339. ;; (source (origin
  340. ;; (method svn-fetch)
  341. ;; (uri (texlive-ref "latex" "microtype"))
  342. ;; (file-name (string-append name "-" version "-checkout"))
  343. ;; (sha256
  344. ;; (base32
  345. ;; "1dwhlxy35bydlljb40ck6d5j93gd4889hpr4j3x8vqhl46k3lfph"))))
  346. ;; (build-system texlive-build-system)
  347. ;; (arguments '(#:tex-directory "latex/microtype"))
  348. ;; ;; (arguments
  349. ;; ;; `(#:modules ((guix build utils))
  350. ;; ;; #:builder
  351. ;; ;; (begin
  352. ;; ;; (use-modules (guix build utils))
  353. ;; ;; (let ((target (string-append (assoc-ref %outputs "out")
  354. ;; ;; "/share/texmf-dist/tex/latex/needspace")))
  355. ;; ;; (mkdir-p target)
  356. ;; ;; (copy-recursively (assoc-ref %build-inputs "source") target)
  357. ;; ;; #t))))
  358. ;; (home-page "https://www.ctan.org/pkg/microtype")
  359. ;; (synopsis "Subliminal refinements towards typographical perfection")
  360. ;; (description
  361. ;; "The package provides a LaTeX interface to the micro-typographic
  362. ;; extensions that were introduced by pdfTeX and have since also propagated to
  363. ;; XeTeX and LuaTeX: most prominently, character protrusion and font expansion,
  364. ;; furthermore the adjustment of interword spacing and additional kerning, as well
  365. ;; as hyphenatable letterspacing (tracking) and the possibility to disable all or
  366. ;; selected ligatures.
  367. ;; These features may be applied to customisable sets of fonts, and all
  368. ;; micro-typographic aspects of the fonts can be configured in a straight-forward
  369. ;; and flexible way. Settings for various fonts are provided.
  370. ;; Note that character protrusion requires pdfTeX, LuaTeX, or XeTeX. Font expansion
  371. ;; works with pdfTeX or LuaTeX. The package will by default enable protrusion and
  372. ;; expansion if they can safely be assumed to work. Disabling ligatures requires
  373. ;; pdfTeX or LuaTeX, while the adjustment of interword spacing and of kerning only
  374. ;; works with pdfTeX. Letterspacing is available with pdfTeX or LuaTeX.
  375. ;; The alternative package @code{letterspace}, which also works with plain TeX, provides
  376. ;; the user commands for letterspacing only, omitting support for all other
  377. ;; extensions.
  378. ;; ")
  379. ;; ;; TODO: Check if this is the proper license.
  380. ;; (license license:lppl1.3c+)))
  381. ;; TODO: Rename texlive-for-org-letter
  382. (define-public texlive-medium
  383. (package
  384. (inherit (texlive-union
  385. (list
  386. texlive-latex-oberdiek
  387. texlive-generic-ifxetex
  388. texlive-latex-wrapfig
  389. texlive-fonts-amsfonts ; For custom letter?
  390. ; texlive-dvips ; For custom letter and marvosym? Already in texlive-union?
  391. ;; texlive-latex-amscls
  392. texlive-latex-amsfonts
  393. ;; texlive-latex-amsmath
  394. ;; texlive-latex-amsrefs
  395. texlive-latex-capt-of
  396. texlive-latex-hyperref
  397. texlive-latex-url
  398. ;; TODO: For custom letter
  399. texlive-fonts-ec
  400. texlive-latex-geometry
  401. texlive-latex-xcolor
  402. ;; TODO: For custom letter + send patches for those.
  403. texlive-fonts-marvosym
  404. texlive-latex-eukdate
  405. texlive-latex-needspace
  406. ;; TODO: For needspace (build inputs)
  407. texlive-latex-filecontents
  408. texlive-latex-titlesec
  409. ;; TODO: needspace needs microtype?
  410. ;; TODO: Send patches for those.
  411. texlive-latex-pgf
  412. texlive-generic-ulem)))
  413. (name "texlive-medium")
  414. (description "This is a very limited subset of the TeX Live distribution.
  415. It includes little more than texlive-tiny.")))