latexpic: Use nix-shell
This commit is contained in:
parent
7791a46986
commit
f8cf89b532
|
@ -1,4 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/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)
|
tmpdir=$(mktemp -d)
|
||||||
cd $tmpdir
|
cd $tmpdir
|
||||||
|
|
||||||
|
@ -19,7 +25,7 @@ $(cat $OLDPWD/$1)
|
||||||
\end{document}
|
\end{document}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
lualatex doc.tex
|
xelatex doc.tex
|
||||||
mutool draw -o doc.svg doc.pdf
|
mutool draw -o doc.svg doc.pdf
|
||||||
inkscape -D -A doc.pdf doc.svg
|
inkscape -D -A doc.pdf doc.svg
|
||||||
mutool draw -r 600 -o $OLDPWD/${1}.png doc.pdf
|
mutool draw -r 600 -o $OLDPWD/${1}.png doc.pdf
|
||||||
|
|
Loading…
Reference in a new issue