update makebook
This commit is contained in:
parent
47bc49bf0e
commit
1c094f9082
32
bin/makebook
32
bin/makebook
@ -6,9 +6,9 @@
|
|||||||
#
|
#
|
||||||
#**********************************************************#
|
#**********************************************************#
|
||||||
# makebook #
|
# makebook #
|
||||||
# written by Donald P. Goodman III #
|
# written by Donald P. Goodman III #
|
||||||
# Copyright (C) 2011 #
|
# Copyright (C) 2011 #
|
||||||
# #
|
# #
|
||||||
# Impose pdf pages for binding #
|
# Impose pdf pages for binding #
|
||||||
#**********************************************************#
|
#**********************************************************#
|
||||||
#
|
#
|
||||||
@ -60,27 +60,27 @@ VERT_OFFSET=0
|
|||||||
SCALE=1
|
SCALE=1
|
||||||
# make sure user has the right programs installed, and die
|
# make sure user has the right programs installed, and die
|
||||||
# horribly if not
|
# horribly if not
|
||||||
command -v od >/dev/null 2>&1 ||
|
command -v od >/dev/null 2>&1 ||
|
||||||
{ echo >&2 "makebook: error: requires od, but it's not installed";
|
{ echo >&2 "makebook: error: requires od, but it's not installed";
|
||||||
exit $E_NO_PROG;
|
exit $E_NO_PROG;
|
||||||
}
|
}
|
||||||
command -v pdflatex >/dev/null 2>&1 ||
|
command -v pdflatex >/dev/null 2>&1 ||
|
||||||
{ echo >&2 "makebook: error: requires pdflatex, but it's not installed";
|
{ echo >&2 "makebook: error: requires pdflatex, but it's not installed";
|
||||||
exit $E_NO_PROG;
|
exit $E_NO_PROG;
|
||||||
}
|
}
|
||||||
command -v pdfinfo >/dev/null 2>&1 ||
|
command -v pdfinfo >/dev/null 2>&1 ||
|
||||||
{ echo >&2 "makebook: error: requires pdfinfo, but it's not installed";
|
{ echo >&2 "makebook: error: requires pdfinfo, but it's not installed";
|
||||||
exit $E_NO_PROG;
|
exit $E_NO_PROG;
|
||||||
}
|
}
|
||||||
command -v pdftk >/dev/null 2>&1 ||
|
command -v pdftk >/dev/null 2>&1 ||
|
||||||
{ echo >&2 "makebook: error: requires pdftk, but it's not installed";
|
{ echo >&2 "makebook: error: requires pdftk, but it's not installed";
|
||||||
exit $E_NO_PROG;
|
exit $E_NO_PROG;
|
||||||
}
|
}
|
||||||
command -v dc >/dev/null 2>&1 ||
|
command -v dc >/dev/null 2>&1 ||
|
||||||
{ echo >&2 "makebook: error: requires dc, but it's not installed";
|
{ echo >&2 "makebook: error: requires dc, but it's not installed";
|
||||||
exit $E_NO_PROG;
|
exit $E_NO_PROG;
|
||||||
}
|
}
|
||||||
command -v bc >/dev/null 2>&1 ||
|
command -v bc >/dev/null 2>&1 ||
|
||||||
{ echo >&2 "makebook: error: requires bc, but it's not installed";
|
{ echo >&2 "makebook: error: requires bc, but it's not installed";
|
||||||
exit $E_NO_PROG;
|
exit $E_NO_PROG;
|
||||||
}
|
}
|
||||||
@ -103,8 +103,8 @@ helpfunc ()
|
|||||||
cat <<End-of-help
|
cat <<End-of-help
|
||||||
makebook v${REVISION}. Copyright (C) 2011, Donald P. Goodman III.
|
makebook v${REVISION}. Copyright (C) 2011, Donald P. Goodman III.
|
||||||
This program comes with ABSOLUTELY NO WARRANTY.
|
This program comes with ABSOLUTELY NO WARRANTY.
|
||||||
This is free software, and you are welcome to
|
This is free software, and you are welcome to
|
||||||
redistribute it under certain conditions; see
|
redistribute it under certain conditions; see
|
||||||
the GNU GPL v3 for details.
|
the GNU GPL v3 for details.
|
||||||
|
|
||||||
-V: Prints license and version information, then exits
|
-V: Prints license and version information, then exits
|
||||||
@ -136,7 +136,7 @@ unitarg ()
|
|||||||
then
|
then
|
||||||
echo "ERROR: dimension \"$1\" not valid." >&2
|
echo "ERROR: dimension \"$1\" not valid." >&2
|
||||||
exit $E_BAD_UNIT
|
exit $E_BAD_UNIT
|
||||||
fi
|
fi
|
||||||
if [ `expr match "$1" '.*\(in\)'` ]
|
if [ `expr match "$1" '.*\(in\)'` ]
|
||||||
then
|
then
|
||||||
OPTARG=`echo "scale=0; ${1%in} * 72" | bc`
|
OPTARG=`echo "scale=0; ${1%in} * 72" | bc`
|
||||||
@ -374,8 +374,8 @@ fi
|
|||||||
tmp=`expr $NUM_PAGES + $NUM_BLANKS`
|
tmp=`expr $NUM_PAGES + $NUM_BLANKS`
|
||||||
if [ $VERBOSE -eq 1 ]
|
if [ $VERBOSE -eq 1 ]
|
||||||
then
|
then
|
||||||
echo "IMPOSING $NUM_PAGES pages ($tmp with blanks) on
|
echo "IMPOSING $NUM_PAGES pages ($tmp with blanks) on
|
||||||
$(dc -e "$NUM_SIGS $SECT_TYPE * p") signature(s) gathered in
|
$(dc -e "$NUM_SIGS $SECT_TYPE * p") signature(s) gathered in
|
||||||
sections of $SECT_TYPE signature(s) each...";
|
sections of $SECT_TYPE signature(s) each...";
|
||||||
fi
|
fi
|
||||||
# arrange the pages for impression on signatures
|
# arrange the pages for impression on signatures
|
||||||
@ -643,8 +643,8 @@ fi
|
|||||||
if [ $VERBOSE -eq 1 ]
|
if [ $VERBOSE -eq 1 ]
|
||||||
then
|
then
|
||||||
echo "`expr $NUM_PAGES + $NUM_BLANKS` pages imposed in
|
echo "`expr $NUM_PAGES + $NUM_BLANKS` pages imposed in
|
||||||
$(dc -e "$NUM_SIGS $SECT_TYPE * p") $SIG_TYPE signatures gathered
|
$(dc -e "$NUM_SIGS $SECT_TYPE * p") $SIG_TYPE signatures gathered
|
||||||
in sections of $SECT_TYPE signature(s) each and output to
|
in sections of $SECT_TYPE signature(s) each and output to
|
||||||
${OUTFILE_NAME%.pdf}.pdf."
|
${OUTFILE_NAME%.pdf}.pdf."
|
||||||
fi
|
fi
|
||||||
if [ "$OUTFILE_NAME" = "stdout" ]
|
if [ "$OUTFILE_NAME" = "stdout" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user