diff options
author | tv <tv@krebsco.de> | 2021-12-08 13:09:23 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2021-12-08 13:09:23 +0100 |
commit | b13349f5d2785ca38141ee5a1717b826a7acfaf6 (patch) | |
tree | 84fb7e3292415a0fab0c7d181301f83d73bb12f7 /README.md | |
parent | c934073436f1b19289634ad1abda6d40d26afb14 (diff) |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 56 |
1 files changed, 16 insertions, 40 deletions
@@ -1,53 +1,29 @@ -# tex2nix +# 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. -## Installation - -With stable nix you can do: - -``` console -nix-build && ./result/bin/tex2nix -``` - -If you use flakes put the following in your inputs - -```nix -{ - inputs.tex2nix.url = "github:Mic92/tex2nix"; - inputs.tex2nix.inputs.utils.follows = "nixpkgs"; -} -``` - -or just do: - -```console -$ nix run github:Mic92/tex2nix -``` - - -## USAGE +## Usage ```console -$ tex2nix main.tex -wrote tex-env.nix -$ cat tex-env.nix -# Generated with tex2nix 0.0.0 -{ texlive }: -(texlive.combine { - inherit (texlive) scheme-small; - "varwidth" = texlive."varwidth"; - "tabu" = texlive."tabu"; - -}) +$ 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) ``` -tex2nix does not follow `\input` or `\include`. However you can specify multiple +texnix does not follow `\input` or `\include`. However you can specify multiple texfiles as input ```console -$ tex2nix *.tex +$ texnix *.tex > tex-env.nix ``` The resulting expression can be imported like this to in your document directory: @@ -56,7 +32,7 @@ The resulting expression can be imported like this to in your document directory # shell.nix with import <nixpkgs> {}; mkShell { - buildInputs = [ (pkgs.callPackage ./tex-env.nix {}) ]; + buildInputs = [ (callPackage ./tex-env.nix {}) ]; } ``` |