I'm using nix to set up a little environment I can use for latex. I want to compile a small standalone document with tikz drawing. So I have this minimal tex file:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw(0,0)circle(8);
\end{tikzpicture}
\end{document}
This should need the pgf package for tikz and the standalone package for standalone. So I have my nix.shell
{ pkgs ? import <nixpkgs> {} }:
let
tex =
pkgs.texlive.combine
{ inherit (pkgs.texlive) scheme-minimal pgf standalone;
};
in
pkgs.mkShell
{ nativeBuildInputs =
[ tex
];
}
If I run my shell and attempt to compile with pdflatex:
[nix-shell:~/Projects/Tex]$ pdflatex example.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/NixOS.org) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./example.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24>
! LaTeX Error: File `standalone.cls' not found.
It seems that latex is not aware of the packages, which isn't very surprising. But I don't really know how to do this. I've looked at texlive on the nixos wiki which doesn't say very much. They have an example which looks like what I have other than the fact it is using the home manager.
How do I make the packages installed via nix available for pdflatex?