Use a common portable pdf rescaling script.
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Fri, 31 May 2013 12:03:40 -0700
changeset 9864 fa7017314b75
parent 9863 989d8bc8f59f
child 9865 4efd43609a1a
Use a common portable pdf rescaling script.
doc/manual/Makefile
doc/manual/rescale-pdf.sh
doc/models/Makefile
doc/models/rescale-pdf.sh
src/antenna/doc/Makefile
src/antenna/doc/rescale-pdf.sh
src/buildings/doc/Makefile
src/buildings/doc/rescale-pdf.sh
src/lte/doc/rescale-pdf.sh
utils/rescale-pdf.sh
--- a/doc/manual/Makefile	Fri May 31 12:01:51 2013 -0700
+++ b/doc/manual/Makefile	Fri May 31 12:03:40 2013 -0700
@@ -28,12 +28,14 @@
 
 IMAGES_TO_CLEAN = $(IMAGES_PNG_CONVERTED) $(IMAGES_PDF) $(IMAGES_EPS)
 
+RESCALE = $(shell hg root)/utils/rescale-pdf.sh
+
 %.eps : %.dia; $(DIA) -t eps $< -e $@
 %.png : %.dia; $(DIA) -t png $< -e $@
 %.png : %.eps; $(CONVERT) $< $@
 %.pdf : %.eps;
 	$(EPSTOPDF) $< -o=$@
-	if test x$($@_width) != x; then ./rescale-pdf.sh $($@_width) $@ ; fi
+	@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
 
 
 # You can set these variables from the command line.
--- a/doc/manual/rescale-pdf.sh	Fri May 31 12:01:51 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-TMPDIR=/tmp
-
-TMPFILE=`mktemp`
-
-echo "\documentclass{book}
-\usepackage{pdfpages}
-\begin{document}
-\includepdf[width=${1},fitpaper]{${2}}
-\end{document}" >${TMPFILE}.tex
-pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
-cp ${TMPFILE}.pdf ${2}
-rm -f ${TMPFILE}{,.{tex,aux,log,pdf}}
--- a/doc/models/Makefile	Fri May 31 12:01:51 2013 -0700
+++ b/doc/models/Makefile	Fri May 31 12:03:40 2013 -0700
@@ -295,12 +295,14 @@
 
 IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
 
+RESCALE = $(shell hg root)/utils/rescale-pdf.sh
+
 %.eps : %.dia; $(DIA) -t eps $< -e $@
 %.png : %.dia; $(DIA) -t png $< -e $@
 %.png : %.eps; $(CONVERT) $< $@
 %.pdf : %.eps
 	$(EPSTOPDF) $< -o=$@
-	if test x$($@_width) != x; then ./rescale-pdf.sh $($@_width) $@ ; fi
+	@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
 
 # You can set these variables from the command line.
 SPHINXOPTS    =
--- a/doc/models/rescale-pdf.sh	Fri May 31 12:01:51 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-TMPDIR=/tmp
-
-TMPFILE=`mktemp`
-
-echo "\documentclass{book}
-\usepackage{pdfpages}
-\begin{document}
-\includepdf[width=${1},fitpaper]{${2}}
-\end{document}" >${TMPFILE}.tex
-pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
-cp ${TMPFILE}.pdf ${2}
-rm -f ${TMPFILE}{,.{tex,aux,log,pdf}}
--- a/src/antenna/doc/Makefile	Fri May 31 12:01:51 2013 -0700
+++ b/src/antenna/doc/Makefile	Fri May 31 12:03:40 2013 -0700
@@ -20,12 +20,14 @@
 
 IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
 
+RESCALE = $(shell hg root)/utils/rescale-pdf.sh
+
 %.eps : %.dia; $(DIA) -t eps $< -e $@
 %.png : %.dia; $(DIA) -t png $< -e $@
 %.png : %.eps; $(CONVERT) $< $@
 %.pdf : %.eps
 	$(EPSTOPDF) $< -o=$@
-	if test x$($@_width) != x; then ./rescale-pdf.sh $($@_width) $@ ; fi
+	@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
 
 GRAPHS_PNG = ${GRAPHS_EPS:.eps=.png}
 GRAPHS_PDF = ${GRAPHS_EPS:.eps=.pdf}
@@ -35,7 +37,7 @@
 %.png : %.eps; $(CONVERT) $< $@
 %.pdf : %.eps
 	$(EPSTOPDF) $< -o=$@
-	if test x$($@_width) != x; then ./rescale-pdf.sh $($@_width) $@ ; fi
+	@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
 
 # You can set these variables from the command line.
 SPHINXOPTS    =
--- a/src/antenna/doc/rescale-pdf.sh	Fri May 31 12:01:51 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-TMPDIR=/tmp
-
-TMPFILE=`mktemp`
-
-echo "\documentclass{book}
-\usepackage{pdfpages}
-\begin{document}
-\includepdf[width=${1},fitpaper]{${2}}
-\end{document}" >${TMPFILE}.tex
-pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
-cp ${TMPFILE}.pdf ${2}
-rm -f ${TMPFILE}{,.{tex,aux,log,pdf}}
--- a/src/buildings/doc/Makefile	Fri May 31 12:01:51 2013 -0700
+++ b/src/buildings/doc/Makefile	Fri May 31 12:03:40 2013 -0700
@@ -20,12 +20,14 @@
 
 IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
 
+RESCALE = $(shell hg root)/utils/rescale-pdf.sh
+
 %.eps : %.dia; $(DIA) -t eps $< -e $@
 %.png : %.dia; $(DIA) -t png $< -e $@
 %.png : %.eps; $(CONVERT) $< $@
 %.pdf : %.eps
 	$(EPSTOPDF) $< -o=$@;
-	if test x$($@_width) != x; then ./rescale-pdf.sh $($@_width) $@ ; fi
+	@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
 
 GRAPHS_PNG = ${GRAPHS_EPS:.eps=.png}
 GRAPHS_PDF = ${GRAPHS_EPS:.eps=.pdf}
@@ -35,7 +37,7 @@
 %.png : %.eps; $(CONVERT) $< $@
 %.pdf : %.eps
 	$(EPSTOPDF) $< -o=$@
-	if test x$($@_width) != x; then ./rescale-pdf.sh $($@_width) $@ ; fi
+	@if test x$($@_width) != x; then $(RESCALE) $($@_width) $@ ; fi
 
 # You can set these variables from the command line.
 SPHINXOPTS    =
--- a/src/buildings/doc/rescale-pdf.sh	Fri May 31 12:01:51 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-TMPDIR=/tmp
-
-TMPFILE=`mktemp`
-
-echo "\documentclass{book}
-\usepackage{pdfpages}
-\begin{document}
-\includepdf[width=${1},fitpaper]{${2}}
-\end{document}" >${TMPFILE}.tex
-pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
-cp ${TMPFILE}.pdf ${2}
-rm -f ${TMPFILE}{,.{tex,aux,log,pdf}}
--- a/src/lte/doc/rescale-pdf.sh	Fri May 31 12:01:51 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-TMPDIR=/tmp
-
-TMPFILE=`mktemp`
-
-echo "\documentclass{book}
-\usepackage{pdfpages}
-\begin{document}
-\includepdf[width=${1},fitpaper]{${2}}
-\end{document}" >${TMPFILE}.tex
-pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
-cp ${TMPFILE}.pdf ${2}
-rm -f ${TMPFILE}{,.{tex,aux,log,pdf}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/utils/rescale-pdf.sh	Fri May 31 12:03:40 2013 -0700
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+TMPDIR=${TMPDIR:-/tmp}
+
+TMPFILE=`mktemp -t $(basename ${2}).XXXXXX`
+
+echo "Rescaling ${2} to ${1}"
+
+echo "
+\documentclass{book}
+  \usepackage{pdfpages}
+  \begin{document}
+    \includepdf[width=${1},fitpaper]{${2}}
+  \end{document}
+" \
+>${TMPFILE}.tex
+
+pdflatex -output-directory ${TMPDIR} ${TMPFILE}.tex >/dev/null 2>/dev/null
+cp ${TMPFILE}.pdf ${2}
+rm -f ${TMPFILE}{,.{tex,aux,log,pdf}}