@@ -1,152 +0,0 @@
1−<section xmlns="http://docbook.org/ns/docbook"
2− xmlns:xlink="http://www.w3.org/1999/xlink"
3− xml:id="sec-language-texlive">
4− <title>TeX Live</title>
5−
6− <para>
7− Since release 15.09 there is a new TeX Live packaging that lives entirely under attribute <varname>texlive</varname>.
8− </para>
9−
10− <section xml:id="sec-language-texlive-users-guide">
11− <title>User's guide</title>
12−
13− <itemizedlist>
14− <listitem>
15− <para>
16− For basic usage just pull <varname>texlive.combined.scheme-basic</varname> for an environment with basic LaTeX support.
17− </para>
18− </listitem>
19− <listitem>
20− <para>
21− It typically won't work to use separately installed packages together. Instead, you can build a custom set of packages like this:
22−<programlisting>
23−texlive.combine {
24− inherit (texlive) scheme-small collection-langkorean algorithms cm-super;
25−}
26−</programlisting>
27− There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences).
28− </para>
29− </listitem>
30− <listitem>
31− <para>
32− By default you only get executables and files needed during runtime, and a little documentation for the core packages. To change that, you need to add <varname>pkgFilter</varname> function to <varname>combine</varname>.
33−<programlisting>
34−texlive.combine {
35− # inherit (texlive) whatever-you-want;
36− pkgFilter = pkg:
37− pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "cm-super";
38− # elem tlType [ "run" "bin" "doc" "source" ]
39− # there are also other attributes: version, name
40−}
41−</programlisting>
42− </para>
43− </listitem>
44− <listitem>
45− <para>
46− You can list packages e.g. by <command>nix repl</command>.
47−<programlisting>
48−<prompt>$ </prompt>nix repl
49−<prompt>nix-repl> </prompt>:l <nixpkgs>
50−<prompt>nix-repl> </prompt>texlive.collection-<keycap function="tab" />
51−</programlisting>
52− </para>
53− </listitem>
54− <listitem>
55− <para>
56− Note that the wrapper assumes that the result has a chance to be useful. For example, the core executables should be present, as well as some core data files. The supported way of ensuring this is by including some scheme, for example <varname>scheme-basic</varname>, into the combination.
57− </para>
58− </listitem>
59− </itemizedlist>
60− </section>
61−
62− <section xml:id="sec-language-texlive-custom-packages">
63− <title>Custom packages</title>
64− <para>
65− You may find that you need to use an external TeX package. A derivation for such package has to provide contents of the "texmf" directory in its output and provide the <varname>tlType</varname> attribute. Here is a (very verbose) example:
66−<programlisting><![CDATA[
67−with import <nixpkgs> {};
68−
69−let
70− foiltex_run = stdenvNoCC.mkDerivation {
71− pname = "latex-foiltex";
72− version = "2.1.4b";
73− passthru.tlType = "run";
74−
75− srcs = [
76− (fetchurl {
77− url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.dtx";
78− sha256 = "07frz0krpz7kkcwlayrwrj2a2pixmv0icbngyw92srp9fp23cqpz";
79− })
80− (fetchurl {
81− url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.ins";
82− sha256 = "09wkyidxk3n3zvqxfs61wlypmbhi1pxmjdi1kns9n2ky8ykbff99";
83− })
84− ];
85−
86− unpackPhase = ''
87− runHook preUnpack
88−
89− for _src in $srcs; do
90− cp "$_src" $(stripHash "$_src")
91− done
92−
93− runHook postUnpack
94− '';
95−
96− nativeBuildInputs = [ texlive.combined.scheme-small ];
97−
98− dontConfigure = true;
99−
100− buildPhase = ''
101− runHook preBuild
102−
103− # Generate the style files
104− latex foiltex.ins
105−
106− runHook postBuild
107− '';
108−
109− installPhase = ''
110− runHook preInstall
111−
112− path="$out/tex/latex/foiltex"
113− mkdir -p "$path"
114− cp *.{cls,def,clo} "$path/"
115−
116− runHook postInstall
117− '';
118−
119− meta = with lib; {
120− description = "A LaTeX2e class for overhead transparencies";
121− license = licenses.unfreeRedistributable;
122− maintainers = with maintainers; [ veprbl ];
123− platforms = platforms.all;
124− };
125− };
126− foiltex = { pkgs = [ foiltex_run ]; };
127−
128− latex_with_foiltex = texlive.combine {
129− inherit (texlive) scheme-small;
130− inherit foiltex;
131− };
132−in
133− runCommand "test.pdf" {
134− nativeBuildInputs = [ latex_with_foiltex ];
135− } ''
136−cat >test.tex <<EOF
137−\documentclass{foils}
138−
139−\title{Presentation title}
140−\date{}
141−
142−\begin{document}
143−\maketitle
144−\end{document}
145−EOF
146− pdflatex test.tex
147− cp test.pdf $out
148−''
149−]]></programlisting>
150− </para>
151− </section>
152−</section>