TexLive: Difference between revisions

imported>StefanSchroeder
m Repair bold.
Crdr (talk | contribs)
Use withPackages to follow the new changes in 23.11, as well as the new names for schemes
 
(8 intermediate revisions by 5 users not shown)
Line 7: Line 7:
organization of TeX Live into 'schemes' and 'collections'
organization of TeX Live into 'schemes' and 'collections'


The following Tex Live schemes are available:
The following Tex Live schemes are available, inspect <code>texlive.schemes</code> for full list:


{| class="wikitable"
{| class="wikitable"
  |-
  |-
  ! Name of TeX Live package
  ! Name of TeX Live package
  ! Name of Nixos-derivation
  ! Name of NixOS-derivation
  ! Comment  
  ! Comment  
  |-
  |-
  |width=20% valign=top| Scheme-full
  |width=20% valign=top| Scheme-full
  |width=50% valign=top| <code>nixpkgs.texlive.combined.scheme-full</code>
  |width=50% valign=top| <code>nixpkgs.texliveFull</code>
  |width=30% valign=top| Contains every TeX Live package
  |width=30% valign=top| Contains every TeX Live package
  |-
  |-
  | Scheme-medium
  | Scheme-medium
  | <code>nixpkgs.texlive.combined.scheme-medium</code>
  | <code>nixpkgs.texliveMedium</code>
  | contains everything in the small scheme + more packages and languages
  | contains everything in the small scheme + more packages and languages
  |-
  |-
  | Scheme-small
  | Scheme-small
  | <code>nixpkgs.texlive.combined.scheme-small</code>
  | <code>nixpkgs.texliveSmall</code>
  | contains everything in the basic scheme + xetex, metapost, a few languages.
  | contains everything in the basic scheme + xetex, metapost, a few languages.
  |-
  |-
  | Scheme-basic
  | Scheme-basic
  | <code>nixpkgs.texlive.combined.scheme-basic</code>
  | <code>nixpkgs.texliveBasic</code>
  | contains everything in the plain scheme but includes latex.
  | contains everything in the plain scheme but includes latex.
  |-
  |-
  | Scheme-minimal
  | Scheme-minimal
  | <code>nixpkgs.texlive.combined.scheme-minimal</code>
  | <code>nixpkgs.texliveMinimal</code>
  | contains plain only.
  | contains plain only.
  |-
  |-
  | Scheme-teTeX
  | Scheme-teTeX
  | <code>nixpkgs.texlive.combined.scheme-tetex</code>
  | <code>nixpkgs.texliveTeTex</code>
  | contains more than the medium scheme, but nowhere near the full scheme.
  | contains more than the medium scheme, but nowhere near the full scheme.
  |-
  |-
  | Scheme-ConTeXt
  | Scheme-ConTeXt
  | <code>nixpkgs.texlive.combined.scheme-context</code>
  | <code>nixpkgs.texliveConTeXt</code>
  | contains ConTeXt
  | contains ConTeXt
  |-
  |-
  | Scheme-GUST
  | Scheme-GUST
  | <code>nixpkgs.texlive.combined.scheme-gust</code>
  | <code>nixpkgs.texliveGUST</code>
  | contains gust
  | contains gust
  |}
  |}
Line 51: Line 51:
You can install a set with extra packages by using something like
You can install a set with extra packages by using something like


<code>(texlive.combine {
<code>(texliveMedium.withPackages (ps: with ps;[xifthen ifmtarg framed paralist titlesec]))
inherit (texlive) scheme-medium xifthen ifmtarg framed paralist titlesec;
})
</code>
</code>
For a minimal set of packages needed for Emacs Orgmode, as described in org-latex-default-packages-alist variable, install these packages:
<pre>
{ config, pkgs, ... }:
let
  tex = (pkgs.texliveBasic.withPackages (
    ps: with ps; [
      dvisvgm dvipng # for preview and export as html
      wrapfig amsmath ulem hyperref capt-of
      #(setq org-latex-compiler "lualatex")
      #(setq org-preview-latex-default-process 'dvisvgm)
  ]));
in
{ # home-manager
  home.packages = with pkgs; [
    tex
  ];
}
</pre>
== Adding a Custom Package ==
If you have a custom LaTeX package or style file that is not part of the TeXLive distribution, you can add it to the package set like this:
First, create a derivation for your package. The contents of <code>$out/tex</code> will later be placed in <code>texmf/tex</code>
latex-corporate-identity = pkgs.stdenvNoCC.mkDerivation {
  name = "latex-corporate-identity";
  src = ./path/to/package/tree;
  installPhase = "cp -r $src $out";
  passthru.tlType = "run";
};
texlive-corporate-identity = {
  pkgs = [ latex-corporate-identity ];
};
The directory tree under the path specified as src looks like this:
└── tex
    └── latex
        └── corporate-identity
            ├── corporate-identity.sty
You can now add the package to the combined set as you would with any other texlive package:
tex =(pkgs.texlive.withPackages (
    ps: with ps; [
      texlive-corporate-identity
  ]));


== Troubleshooting ==
== Troubleshooting ==
Line 69: Line 112:
* [https://www.tug.org/texlive/doc/texlive-en/texlive-en.html The Tex Live Guide 2018]
* [https://www.tug.org/texlive/doc/texlive-en/texlive-en.html The Tex Live Guide 2018]
* [[Tex]] in NixOS-Wiki
* [[Tex]] in NixOS-Wiki
* [https://flyx.org/nix-flakes-latex/ Building LaTeX Documents Reproducibly with Nix Flakes]
[[Category:Applications]]