summary refs log tree commit diff
path: root/doc/languages-frameworks
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2020-12-03 06:15:27 +0000
committerGitHub <noreply@github.com>2020-12-03 06:15:27 +0000
commit6f36a7f7c3405a7becdd6c8904afc8d8ae5035fb (patch)
tree12b31a5ac0404943a375ebe832a9c616e1c26772 /doc/languages-frameworks
parent58274c4f8d1deda9891c370273735987584c1615 (diff)
parent3a2e9d2ac7e826eacc1dd99f07f9b06242b04e14 (diff)
downloadnixpkgs-6f36a7f7c3405a7becdd6c8904afc8d8ae5035fb.tar
nixpkgs-6f36a7f7c3405a7becdd6c8904afc8d8ae5035fb.tar.gz
nixpkgs-6f36a7f7c3405a7becdd6c8904afc8d8ae5035fb.tar.bz2
nixpkgs-6f36a7f7c3405a7becdd6c8904afc8d8ae5035fb.tar.lz
nixpkgs-6f36a7f7c3405a7becdd6c8904afc8d8ae5035fb.tar.xz
nixpkgs-6f36a7f7c3405a7becdd6c8904afc8d8ae5035fb.tar.zst
nixpkgs-6f36a7f7c3405a7becdd6c8904afc8d8ae5035fb.zip
Merge master into staging-next
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r--doc/languages-frameworks/index.xml2
-rw-r--r--doc/languages-frameworks/texlive.section.md128
-rw-r--r--doc/languages-frameworks/texlive.xml152
3 files changed, 129 insertions, 153 deletions
diff --git a/doc/languages-frameworks/index.xml b/doc/languages-frameworks/index.xml
index c302b67cfd5..5046ce00b9a 100644
--- a/doc/languages-frameworks/index.xml
+++ b/doc/languages-frameworks/index.xml
@@ -29,7 +29,7 @@
  <xi:include href="r.section.xml" />
  <xi:include href="ruby.section.xml" />
  <xi:include href="rust.section.xml" />
- <xi:include href="texlive.xml" />
+ <xi:include href="texlive.section.xml" />
  <xi:include href="titanium.section.xml" />
  <xi:include href="vim.section.xml" />
 </chapter>
diff --git a/doc/languages-frameworks/texlive.section.md b/doc/languages-frameworks/texlive.section.md
new file mode 100644
index 00000000000..9584c56bb52
--- /dev/null
+++ b/doc/languages-frameworks/texlive.section.md
@@ -0,0 +1,128 @@
+
+# TeX Live {#sec-language-texlive}
+
+Since release 15.09 there is a new TeX Live packaging that lives entirely under attribute `texlive`.
+
+## User's guide {#sec-language-texlive-user-guide}
+
+- For basic usage just pull `texlive.combined.scheme-basic` for an environment with basic LaTeX support.
+- It typically won't work to use separately installed packages together. Instead, you can build a custom set of packages like this:
+
+  ```nix
+  texlive.combine {
+    inherit (texlive) scheme-small collection-langkorean algorithms cm-super;
+  }
+  ```
+
+- There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences).
+- 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 `pkgFilter` function to `combine`.
+
+  ```nix
+  texlive.combine {
+    # inherit (texlive) whatever-you-want;
+    pkgFilter = pkg:
+      pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "cm-super";
+    # elem tlType [ "run" "bin" "doc" "source" ]
+    # there are also other attributes: version, name
+  }
+  ```
+
+- You can list packages e.g. by `nix repl`.
+
+  ```ShellSession
+  $ nix repl
+  nix-repl> :l <nixpkgs>
+  nix-repl> texlive.collection-[TAB]
+  ```
+
+- 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 `scheme-basic`, into the combination.
+
+## Custom packages {#sec-language-texlive-custom-packages}
+
+
+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 `tlType` attribute. Here is a (very verbose) example:
+
+```nix
+with import <nixpkgs> {};
+
+let
+  foiltex_run = stdenvNoCC.mkDerivation {
+    pname = "latex-foiltex";
+    version = "2.1.4b";
+    passthru.tlType = "run";
+
+    srcs = [
+      (fetchurl {
+        url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.dtx";
+        sha256 = "07frz0krpz7kkcwlayrwrj2a2pixmv0icbngyw92srp9fp23cqpz";
+      })
+      (fetchurl {
+        url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.ins";
+        sha256 = "09wkyidxk3n3zvqxfs61wlypmbhi1pxmjdi1kns9n2ky8ykbff99";
+      })
+    ];
+
+    unpackPhase = ''
+      runHook preUnpack
+
+      for _src in $srcs; do
+        cp "$_src" $(stripHash "$_src")
+      done
+
+      runHook postUnpack
+    '';
+
+    nativeBuildInputs = [ texlive.combined.scheme-small ];
+
+    dontConfigure = true;
+
+    buildPhase = ''
+      runHook preBuild
+
+      # Generate the style files
+      latex foiltex.ins
+
+      runHook postBuild
+    '';
+
+    installPhase = ''
+      runHook preInstall
+
+      path="$out/tex/latex/foiltex"
+      mkdir -p "$path"
+      cp *.{cls,def,clo} "$path/"
+
+      runHook postInstall
+    '';
+
+    meta = with lib; {
+      description = "A LaTeX2e class for overhead transparencies";
+      license = licenses.unfreeRedistributable;
+      maintainers = with maintainers; [ veprbl ];
+      platforms = platforms.all;
+    };
+  };
+  foiltex = { pkgs = [ foiltex_run ]; };
+
+  latex_with_foiltex = texlive.combine {
+    inherit (texlive) scheme-small;
+    inherit foiltex;
+  };
+in
+  runCommand "test.pdf" {
+    nativeBuildInputs = [ latex_with_foiltex ];
+  } ''
+cat >test.tex <<EOF
+\documentclass{foils}
+
+\title{Presentation title}
+\date{}
+
+\begin{document}
+\maketitle
+\end{document}
+EOF
+  pdflatex test.tex
+  cp test.pdf $out
+''
+```
diff --git a/doc/languages-frameworks/texlive.xml b/doc/languages-frameworks/texlive.xml
deleted file mode 100644
index 141c46e5a62..00000000000
--- a/doc/languages-frameworks/texlive.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-<section xmlns="http://docbook.org/ns/docbook"
-         xmlns:xlink="http://www.w3.org/1999/xlink"
-         xml:id="sec-language-texlive">
- <title>TeX Live</title>
-
- <para>
-  Since release 15.09 there is a new TeX Live packaging that lives entirely under attribute <varname>texlive</varname>.
- </para>
-
- <section xml:id="sec-language-texlive-users-guide">
-  <title>User's guide</title>
-
-  <itemizedlist>
-   <listitem>
-    <para>
-     For basic usage just pull <varname>texlive.combined.scheme-basic</varname> for an environment with basic LaTeX support.
-    </para>
-   </listitem>
-   <listitem>
-    <para>
-     It typically won't work to use separately installed packages together. Instead, you can build a custom set of packages like this:
-<programlisting>
-texlive.combine {
-  inherit (texlive) scheme-small collection-langkorean algorithms cm-super;
-}
-</programlisting>
-     There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences).
-    </para>
-   </listitem>
-   <listitem>
-    <para>
-     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>.
-<programlisting>
-texlive.combine {
-  # inherit (texlive) whatever-you-want;
-  pkgFilter = pkg:
-    pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "cm-super";
-  # elem tlType [ "run" "bin" "doc" "source" ]
-  # there are also other attributes: version, name
-}
-</programlisting>
-    </para>
-   </listitem>
-   <listitem>
-    <para>
-     You can list packages e.g. by <command>nix repl</command>.
-<programlisting>
-<prompt>$ </prompt>nix repl
-<prompt>nix-repl> </prompt>:l &lt;nixpkgs>
-<prompt>nix-repl> </prompt>texlive.collection-<keycap function="tab" />
-</programlisting>
-    </para>
-   </listitem>
-   <listitem>
-    <para>
-     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.
-    </para>
-   </listitem>
-  </itemizedlist>
- </section>
-
- <section xml:id="sec-language-texlive-custom-packages">
-  <title>Custom packages</title>
-  <para>
-    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:
-<programlisting><![CDATA[
-with import <nixpkgs> {};
-
-let
-  foiltex_run = stdenvNoCC.mkDerivation {
-    pname = "latex-foiltex";
-    version = "2.1.4b";
-    passthru.tlType = "run";
-
-    srcs = [
-      (fetchurl {
-        url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.dtx";
-        sha256 = "07frz0krpz7kkcwlayrwrj2a2pixmv0icbngyw92srp9fp23cqpz";
-      })
-      (fetchurl {
-        url = "http://mirrors.ctan.org/macros/latex/contrib/foiltex/foiltex.ins";
-        sha256 = "09wkyidxk3n3zvqxfs61wlypmbhi1pxmjdi1kns9n2ky8ykbff99";
-      })
-    ];
-
-    unpackPhase = ''
-      runHook preUnpack
-
-      for _src in $srcs; do
-        cp "$_src" $(stripHash "$_src")
-      done
-
-      runHook postUnpack
-    '';
-
-    nativeBuildInputs = [ texlive.combined.scheme-small ];
-
-    dontConfigure = true;
-
-    buildPhase = ''
-      runHook preBuild
-
-      # Generate the style files
-      latex foiltex.ins
-
-      runHook postBuild
-    '';
-
-    installPhase = ''
-      runHook preInstall
-
-      path="$out/tex/latex/foiltex"
-      mkdir -p "$path"
-      cp *.{cls,def,clo} "$path/"
-
-      runHook postInstall
-    '';
-
-    meta = with lib; {
-      description = "A LaTeX2e class for overhead transparencies";
-      license = licenses.unfreeRedistributable;
-      maintainers = with maintainers; [ veprbl ];
-      platforms = platforms.all;
-    };
-  };
-  foiltex = { pkgs = [ foiltex_run ]; };
-
-  latex_with_foiltex = texlive.combine {
-    inherit (texlive) scheme-small;
-    inherit foiltex;
-  };
-in
-  runCommand "test.pdf" {
-    nativeBuildInputs = [ latex_with_foiltex ];
-  } ''
-cat >test.tex <<EOF
-\documentclass{foils}
-
-\title{Presentation title}
-\date{}
-
-\begin{document}
-\maketitle
-\end{document}
-EOF
-  pdflatex test.tex
-  cp test.pdf $out
-''
-]]></programlisting>
-  </para>
- </section>
-</section>