From 10d1fcd0e7590c1d5e6dcbf171dc7d78134738d6 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Wed, 12 Aug 2020 18:26:27 +0200 Subject: [PATCH] Add helpers functions --- helpers/functions/asy2png | 10 ++++++++++ helpers/init.zsh | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 helpers/functions/asy2png create mode 100644 helpers/init.zsh diff --git a/helpers/functions/asy2png b/helpers/functions/asy2png new file mode 100644 index 0000000..011611c --- /dev/null +++ b/helpers/functions/asy2png @@ -0,0 +1,10 @@ +# +# Create an image file from an asymptote file and convert it to svg and png +# + +asy "$1" +filename=$(basename -s .asy "$1") + +convert -density 300 "${filename}.pdf" -quality 100 $(echo "${filename}.pdf" | sed -e 's/pdf$/svg/') + +convert -density 300 "${filename}.pdf" -quality 100 $(echo "${filename}.pdf" | sed -e 's/pdf$/png/') diff --git a/helpers/init.zsh b/helpers/init.zsh new file mode 100644 index 0000000..58f2503 --- /dev/null +++ b/helpers/init.zsh @@ -0,0 +1,3 @@ +# +# Helpers aliases +# \ No newline at end of file