summaryrefslogtreecommitdiff
path: root/tools/gendocs.sh
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-05-09 20:40:42 -0700
committerCraig Earls <enderw88@gmail.com>2014-05-09 20:40:42 -0700
commit20b915668f7e6d4be9993e11dfc04ae1760a36f7 (patch)
tree668de51ac7625355aaaa8c3c88aed82344c690c3 /tools/gendocs.sh
parent2906a2f759b67363c070161202596e746921f09c (diff)
parentdbfbf2bc893de3c44dcc08c33811bc274f647672 (diff)
downloadfork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.tar.gz
fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.tar.bz2
fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.zip
Merge commit 'dbfbf2bc893de3c44dcc08c33811bc274f647672'
Diffstat (limited to 'tools/gendocs.sh')
-rwxr-xr-xtools/gendocs.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/tools/gendocs.sh b/tools/gendocs.sh
index 9126a406..483f0230 100755
--- a/tools/gendocs.sh
+++ b/tools/gendocs.sh
@@ -1,5 +1,29 @@
#!/bin/bash
+
+# By default US Letter is used as the PDF papersize.
+# For those preferring other dimensions add a4 or small
+# as a commandline argument to this script to create a
+# DIN A4 or smallbook version of the PDF.
+case $1 in
+ a4*|afour*)
+ papersize='--texinfo=@afourpaper';;
+ small*)
+ papersize='--texinfo=@smallbook';;
+ *)
+ papersize='';; # US Letter is texinfo default
+esac
+
+# Use keg-only Mac Hombrew texinfo if installed.
+# Since texi2pdf is a shell script itself executing texi2dvi
+# PATH is prepended with the path to correct texinfo scripts.
+if [ $(uname -s) = 'Darwin' ]; then
+ brew list texinfo >/dev/null 2>&1 \
+ && export PATH="$(brew --prefix texinfo)/bin:$PATH"
+fi
+
echo "===================================== Making Info..."
makeinfo ledger3.texi
+echo "===================================== Making HTML..."
+makeinfo --html --no-split ledger3.texi
echo "===================================== Making PDF..."
-texi2pdf --quiet --batch ledger3.texi
+texi2pdf --quiet --batch ${papersize} ledger3.texi