aboutsummaryrefslogtreecommitdiffstats

texnix

texnix is based on tex2nix.

Generate Texlive environment containing all dependencies for your document rather than downloading gigabytes of texlive packages.

Usage

$ echo '\usepackage{babel}' | texnix -
# Generated with texnix 1.0.0
{ texlive, extraTexPackages ? {} }:
texlive.combine ({
  inherit (texlive) scheme-small;
  "babel" = texlive."babel";
  "ctablestack" = texlive."ctablestack";
  "luatexbase" = texlive."luatexbase";
} // extraTexPackages)

texnix does not follow \input or \include. However you can specify multiple texfiles as input

$ texnix *.tex > tex-env.nix

The resulting expression can be imported like this to in your document directory:

# shell.nix
with import <nixpkgs> {};
mkShell {
  buildInputs = [ (callPackage ./tex-env.nix {}) ];
}
$ nix-shell shell.nix
nix-shell> pdflatex --version
pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020/NixOS.org)
...