From f8cf89b53209428dddc24a80fd913b057dede42e Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 2 Oct 2020 17:18:05 +0200 Subject: [PATCH] latexpic: Use nix-shell --- latexpic.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/latexpic.sh b/latexpic.sh index c39bea3..5bfca9a 100755 --- a/latexpic.sh +++ b/latexpic.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash +# shellception since nix-shell and shebang does not work with combining texlive +if ! command -v xelatex >> /dev/null; then + nix-shell -p 'texlive.combine { inherit (pkgs.texlive) scheme-small chemfig simplekv siunitx standalone varwidth; }' --run "$0 $@" + exit $? +fi + tmpdir=$(mktemp -d) cd $tmpdir @@ -19,7 +25,7 @@ $(cat $OLDPWD/$1) \end{document} EOF -lualatex doc.tex +xelatex doc.tex mutool draw -o doc.svg doc.pdf inkscape -D -A doc.pdf doc.svg mutool draw -r 600 -o $OLDPWD/${1}.png doc.pdf