summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/mpost/mptest
blob: cfc94b6bc0102c38ba99200b3f19997ae3955fe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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