#!/bin/sh
# mptest -- script to process a single picture file through MetaPost
#           to produce an eps file
#
# Usage: ./mptest file
# You may have to make this file executable first.
#
# e.g. copy ex01.m4 here and type ./mptest ex01
# Starting with file.m4, invoke m4, dpic -s, and MetaPost to produce file.1

LIBS=mpost.m4

rm -f $1.ps F$1.* $1.1 $1.mp $1.pic
m4 $LIBS $1.m4 > $1.pic

# Write the LaTeX heading.  The = signs get translated to backslashes
#
( echo 'verbatimtex
=documentclass[11pt]{article}
=usepackage{times,boxdims}=usepackage{graphicx}
=usepackage{siunitx}
=begin{document} etex
') | tr '=' '\134' > $1.mp

dpic -s $1.pic >> $1.mp

TEX=latex mpost $1.mp end
