aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2019-08-09 17:11:06 +0200
committerDavid Runge <dave@sleepmap.de>2019-08-09 17:11:06 +0200
commit47453baa29ae4967ecf04e13cc95dfde872956e1 (patch)
tree87517e30886d5b3af8de2f57eed54a93bde77beb
parentee8d5dbeead8a03b8763b148ce032254b8c1a04f (diff)
downloaddotfiles-47453baa29ae4967ecf04e13cc95dfde872956e1.tar.gz
dotfiles-47453baa29ae4967ecf04e13cc95dfde872956e1.tar.bz2
dotfiles-47453baa29ae4967ecf04e13cc95dfde872956e1.tar.xz
dotfiles-47453baa29ae4967ecf04e13cc95dfde872956e1.zip
bin/tex2pdf: Adding function to render svgs to pdf using inkscape. Adding informational echo to render_diags() and render_svgs().
-rwxr-xr-xbin/tex2pdf13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/tex2pdf b/bin/tex2pdf
index d892300..d11c830 100755
--- a/bin/tex2pdf
+++ b/bin/tex2pdf
@@ -98,6 +98,7 @@ function cleanup()
}
render_diags() {
+ echo "Rendering diagrams to pdfs."
if [ -d "${dirname}/diag/" ] && [ -x /usr/bin/seqdiag ] ; then
for _diag in "${dirname}/diag/"*.diag; do
seqdiag -T 'PDF' "${_diag}"
@@ -105,10 +106,22 @@ render_diags() {
fi
}
+render_svgs() {
+ echo "Rendering SVGs to pdfs."
+ for dir in "${dirname}/images" "${dirname}/../images"; do
+ if [ -d "${dir}" ]; then
+ for svg in "${dir}/"*; do
+ inkscape -D -z -A "${svg%\.svg}".pdf "${svg}"
+ done
+ fi
+ done
+}
+
probe_extension $1
get_filename $1
get_dirname $1
render_diags
+render_svgs
echo "tex2pdf: Converting $filename$input_suffix to $filename$output_suffix."
probe_tools
create_pdf