Like TeX and Metafont, MetaPost is normally used with a large body of precompiled macros.
An argument given on the command line behaves as the first input line. That can be either a (possibly truncated) file name or a sequence MetaPost commands starting with \ and including an input command. Thus
mpost figsprocesses the file figs.mp. The basename of figs becomes the ``jobname'', and is used in forming output file names. If no file is named, the jobname becomes mpout. The default extension, .mp, can be overridden by specifying an extension explicitly.
There is normally one output file for each picture generated, and the output files are named jobname.nnn, where nnn is a number passed to the beginfig macro. The output file name can also be jobname.ps if this number is negative.
The output files can be used as figures in a LaTeX document by using package graphicx and then using the macro
\includegraphics*[height=H, width=W]{ jobname.nnn}to produce a box of the appropriate size H x W containing the figure.
The output files can be used as figures in a TeX document by including
\special{psfile=jobname.nnn}in the TeX document. Alternatively, one can \input epsf.tex and then use the macro
\epsfbox{jobname.nnn}to produce a box of the appropriate size containing the figure.
% Use LaTeX, not TeX, in btex ... etex,
% and use PostScript fonts.
verbatimtex
\documentclass{article}
\usepackage{times}
\usepackage{mathptm}
\begin{document}
etex
% Literal text uses Times-Roman
defaultfont := "ptmr";
% Generate EPS
prologues := 1;
(The lines that start with a % are comments.)
verbatimtex
\end{document}
etex
end
Such a line can safely be added to your .cshrc file as none of the other TeX-related software uses such a variable.setenv TEX latex
| Title | .dvi file | .ps file |
|---|---|---|
| Drawing graphs with MetaPost | mpgraph.dvi | mpgraph.ps |
| The MetaPost system | mpintro.dvi | mpintro.ps |
| A User's manual for MetaPost | mpman.dvi | mpman.ps |