[metapost] How to use MetaPost

Robert Jerrard rjerrard at math.concordia.ab.ca
Mon Nov 26 18:33:05 CET 2007


On Mon, 2007-26-11 at 13:09 +0100, Nizar Fakhfakh wrote:
> Hello,
> I'm beeing to manipulate Miktex and I'm needed to use MetaPost but I'm
> not understand how beging, how to compile MetaPost source code... I
> use Vista Home Premium operating system.
> Thanks to answer me. 
> --
> http://tug.org/mailman/listinfo/metapost

Hi Nizar, I don't use Miktex but I do use MetaPost and LaTeX. I have
found:
http://www.tlhiv.org/MetaPost/documentation/MetaPost_Learning.pdf
quite useful for metapost examples.

The user manual is at:
http://www.tug.org/docs/metapost/mpman.pdf

The idea is to create a text file, say graphs.mp (always use the .mp
extension), with the appropriate metapost commands in it then run the
command:
mpost graphs.mp
from a command line.

In your tex file, say file.tex, use commands like:
\usepackage{graphicx} 
in the preamble and:
\includegraphics{graphs.1}
in the body of the text. When you latex file.tex, the resulting file.dvi
will have the graph in it. I usually create a postscript file for
viewing with the command:
dvips file.dvi -o
which creates file.ps and it can be viewed with any postscript viewer.

Files like graphs.1 are generated when you mpost the .mp file and are
numbered according to the figure numbers in the .mp file.

It is also possible to embed the metapost commands inside the tex file
with the use of metagraph.mp which is available at:
http://linux.softpedia.com/progDownload/METAGRAPH-Download-7598.html
or
http://www.sourcefiles.org/Scientific/Statistics_and_Graphing/

Metagraph was created for drawing directed and undirected graphs but
allows one to embed metpost into a tex file also.

HTH, Bob 
-- 
Dr. Robert J. Jerrard, Professor of Mathematics,
Concordia University College of Alberta,
7128 Ada Blvd., Edmonton, Alberta, T5B 4E4, Canada.
Phone: (780) 479-9291, Fax: (780) 474-1933.




More information about the metapost mailing list