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