aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 57bde75dcb6ba8f2fbda80e50479b8dd572fd44a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# texnix

_texnix is based on [tex2nix](https://github.com/Mic92/tex2nix)._

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

## Usage

```console
$ 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

```console
$ texnix *.tex > tex-env.nix
```

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

```nix
# shell.nix
with import <nixpkgs> {};
mkShell {
  buildInputs = [ (callPackage ./tex-env.nix {}) ];
}
```

``` console
$ nix-shell shell.nix
nix-shell> pdflatex --version
pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020/NixOS.org)
...
```