[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mgp-users 00818] Re: Creating paper slides...



On Tue, 26 Mar 2002 19:09:59 -0800
"George V. Neville-Neil" <gnn@neville-neil.com> wrote:
> 
> 	I'm having a few problems with getting MagicPoint to generate good,
> letter (I'm in the US), paper slides.
> 
> 	If I use the mgp-entex stuff in mgp.el I get a file that is in protrait
> mode when it's turned into PS. 
> 
> 	If I used mgp2ps the output has spacing problems.
> 
> 	What are people doing to get their slides into landscape so they
> can be made into good handouts?
> 
Here is the script that I use for creating paper handouts for my students.
Your papersize problem should be solvable with psresize (part of the psutils
package). Beside from psnup (part of psutils) my script also uses a script
"pspage" that I have written (available from 
http://lionel.kr.fh-niederrhein.de/PAGES/dozenten/dalitz/data/software/pspage).

The rescaling of the images is necessary because I do my presentations
with a resolution 1024x768, while mgp2ps only supports 800x600.

Another caveat is that mgp2ps has a number of bugs which result in incorrect
postscript. Some of these I have fixed in my copy of mgp2ps; if you need
the patches, don't hesitate to ask me.

Christoph Dalitz

-- snip --------------------------------------------------------------------
#!/bin/sh
#
# makeps - translation of MGP to PS with mgp2ps
#          4up printing with option -4up
#
# procedure:
#  a) replace font definitions with those mgp2ps understands (ie. Times)
#  b) rescale EPS-Images
#  b) translate to PS with mgp2ps
#  c) replace Times-Font (the only one mgp2s knows) with wished font
#  d) add margin with psnup
#
# This version of makeps omits steps a) and c), because the patched
# mgp2ps version mgp-1.09a-cd now recognizes NewCenturySchlbk
#

# constant variables
TMPMGP=v4ps.mgp
EPSSCALE=0.75
FOOTER="Dalitz THI"

# initialization command line options
INMGP=""
FOURUP=0
USAGEMSG="Usage: `basename $0` [-4up] <mgpfile>"

# parse command line
while [ $# -gt 0 ]
do
	case "$1" in
		-4up) FOURUP=1;;
		-*)   echo -e "$USAGEMSG" 1>&2; exit 1;;
		*)    INMGP=$1;;
	esac
	shift
done
if [ -z "$INMGP" -o ! -e "$INMGP" ]
then
	echo -e $USAGEMSG 1>&2
	exit 1
fi
if [ $FOURUP = 1 ]
then
    OUTPS=`basename $INMGP .mgp`-4up.ps
else
    OUTPS=`basename $INMGP .mgp`.ps
fi
FOOTER="$FOOTER `basename $INMGP .mgp | tr 'a-z' 'A-Z'`"

echo "$INMGP -> $OUTPS ..."

# rescale images from 1024x768 to 800x600
awk '
BEGIN {}
# rescale images
/^%.*image/ {
	N = split($0, field, " +");
	for (n=1; n<=N; n++) {
		if (match(field[n],"image") && (n+5<=N)) {
			printf("%s ", field[n]);
			# next fields: file scaleflag xscale yscale
			printf("%s ", field[++n]);
			printf("%s ", field[++n]);
			printf("%d ", field[++n] * epsscale);
			printf("%d ", field[++n] * epsscale);
		} else {
			if (n<N) {
				printf("%s ", field[n]);
			} else {
				printf("%s\n", field[n]);
			}
		}
	}
	getline;
}
# print all other lines unchanged
{print;}
END{}
' epsscale=$EPSSCALE $INMGP > $TMPMGP

# convert to PS
if [ $FOURUP = 1 ]
then
	mgp2ps -e latin1 $TMPMGP | \
		pspage -l -font NewCenturySchlbk-Roman:22 | \
		psnup -l -4 -c -b0.7cm -m1.3cm | \
		pspage -l -font Times-Italic:10 -rtext "$FOOTER" \
		> $OUTPS
else
	mgp2ps -e latin1 $TMPMGP | \
		psnup -1 -m2cm | \
		pspage -l -font Times-Italic:12 -rtext "$FOOTER - %p" \
		> $OUTPS
fi

rm $TMPMGP