How to depend on latex environments?

TL;DR: Are there guidelines for depending on configurable packages like python.withPackages or texlive.combine ?

Hi,

My PR for qtikz raised an issue about how to handle a dependency on a latex environment.

Qtikz is an interactive editor for tikz pictures, in the sense that the source code is automatically compiled so as to show in real time what the figure looks like.

Obviously, this package depends on a latex environment containing at least tikz, and also preview. If we provide a default environment, it will make qtikz easy to test directly. The other option is to build qtikz without any dependency on latex, and let it catch the one in the user environment. This makes the package look “broken” on first install, but avoids duplicating the tex environment if the user provides one, ans avoids any possible confusion on which one is used.

So, are there any guidelines for depending on configurable packages like python.withPackages or texlive.combine ?

– Layus.

Just to add to this, I feel the possible solutions are:

  • Use a minimal tex which contains tikz and preview and override the path that is passed into qtikz
  • Use environment tex
  • Use a minimal tex that can be overriden by an argument

Let me know if I have missed anything
I think we are in agreement that the ideal somehow depends on the environment tex and adds the required dependencies but that this is not possible (at least as a package, maybe this is attainable as a nixos module though this feels like overengineering the problem to me)

1 Like

If you know beforehand exactly what packages are needed, then you can add those to texlive.combine or python.withPackages and include it as a dependency. If, on the other, the user may want to have different packages that need to exist in the same environment, then there are two options: an option, or whatever is on PATH. It really depends on the use-case.