latexpic: Use nix-shell

master
Simon Bruder 2020-10-02 17:18:05 +02:00
parent 7791a46986
commit f8cf89b532
No known key found for this signature in database
GPG Key ID: 6F03E0000CC5B62F
1 changed files with 7 additions and 1 deletions

View File

@ -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