Delete empty pages from pdf
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Mon, 2 Oct 2017 14:17:35 +0000 (16:17 +0200)
committerValentin Vidic <Valentin.Vidic@CARNet.hr>
Mon, 2 Oct 2017 14:17:35 +0000 (16:17 +0200)
debian/fix_latex [new file with mode: 0755]
debian/rules

diff --git a/debian/fix_latex b/debian/fix_latex
new file mode 100755 (executable)
index 0000000..96179e0
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = "-l" ]; then
+    # ignore lang settings
+    shift 2
+fi
+
+# prevent latex from adding empty pages
+sed '1s|^\(\\documentclass\[.*\)\(\]{book}\)|\1,openany\2|' <$1 >$2
index b94f454..447df9d 100755 (executable)
@@ -24,7 +24,7 @@ override_dh_auto_build:
        mv doc/index.html doc/carnet-upgrade.html
 
        # Build pdf docs
-       (cd doc; debiandoc2pdf -l hr_HR.UTF-8 carnet-upgrade.sgml)
+       (cd doc; debiandoc2pdf -l hr_HR.UTF-8 -s ../debian/fix_latex carnet-upgrade.sgml)
        rm doc/carnet-upgrade.tpt
 
 override_dh_install: