Add bundled report example

This commit is contained in:
2020-11-17 15:51:09 +01:00
parent fe0bd8b200
commit 33f6ae7e55
7 changed files with 92 additions and 30 deletions

View File

@@ -8,27 +8,17 @@
, sedReport
}:
let
# TODO: We can select only which elements we need from fig by using:
# echo [ $(grep -o '@[^ @]*@' garlic/report.tex | sed 's/@//g') ]
# and them importing as valid nix lang.
# By now, we require all plots
figJSON = writeText "fig.json" (builtins.toJSON fig);
sedCmd = (import sedReport) fig;
in
stdenv.mkDerivation {
name = "report";
src = ./.;
name = "report.pdf";
src = ./report;
buildInputs = [ jq texlive.combined.scheme-basic ];
buildPhase = ''
${sedCmd}
cat report.tex
pdflatex report.tex -o report.pdf
# Run again to fix figure references
pdflatex report.tex -o report.pdf
make
'';
installPhase = ''
mkdir $out
cp report.* $out
cp report.pdf $out
'';
}