| 1 |
#!/bin/sh |
| 2 |
# mptest -- script to process a single picture file through MetaPost |
| 3 |
# to produce an eps file |
| 4 |
# |
| 5 |
# Usage: ./mptest file |
| 6 |
# You may have to make this file executable first; that is: chmod +x mptest |
| 7 |
# |
| 8 |
# e.g. copy ex01.m4 here and type ./mptest ex01 |
| 9 |
# Starting with file.m4, invoke m4, dpic -s, and MetaPost to produce file.1 |
| 10 |
|
| 11 |
LIBS=mpost.m4 |
| 12 |
|
| 13 |
rm -f $1.ps F$1.* $1.1 $1.mp $1.pic |
| 14 |
m4 $LIBS $1.m4 > $1.pic |
| 15 |
|
| 16 |
# Write the LaTeX heading. The = signs get translated to backslashes |
| 17 |
# |
| 18 |
( echo 'verbatimtex |
| 19 |
=documentclass[11pt]{article} |
| 20 |
=usepackage{times,boxdims}=usepackage{graphicx} |
| 21 |
=usepackage{siunitx} |
| 22 |
=begin{document} etex |
| 23 |
') | tr '=' '\134' > $1.mp |
| 24 |
|
| 25 |
dpic -s $1.pic >> $1.mp |
| 26 |
|
| 27 |
TEX=latex mpost $1.mp end |