Glad you got it working! Just for future reference, here's how I usually set things up:
- I make a stack.yaml file with contents something like the following:
resolver: lts-13.27
packages: []
extra-deps:
- diagrams-pgf-1.4.1
- diagrams-rasterific-1.4.1.1
- texrunner-0.0.1.2
- diagrams-builder-0.8.0.4
- haskell-src-exts-simple-1.20.0.0
flags:
diagrams-builder:
pgf: true
rasterific: true
The important part here is the 'flags' section which makes sure that the diagrams-builder-pgf and diagrams-builder-rasterific executables will be installed (just the -pgf one would do as well, depending on your needs).
- Then I call pdflatex with a command like
stack exec --package diagrams-lib --package diagrams-pgf --package diagrams-contrib --package diagrams-builder --package palette -- pdflatex --enable-write18 lectures.tex
(with whatever packages I need). I'm not sure if all of this is 100% necessary, but this is the way I've been able to get things to consistently work without creating an actual Haskell package with a .cabal file etc. In particular without the --package arguments it seems that stack sometimes gets confused about what needs to be in scope in the exec environment while running pdflatex.
-Brent