[texhax] metapost

Reinhard Kotucha reinhard.kotucha at web.de
Sat Jun 18 01:15:46 CEST 2005

>>>>> "Florian" == Florian Knorn <floz at gmx.de> writes:

  > if i run mp fig1.mp he says undefined control sequence
  > \documentclass ....  the reason for this, i guess, is that it runs
  > tex on it, not latex. so i found i have to use mp --tex=latex
  > fig1.mp .

you can try  mp --parse-first-line fig1.mp  instead.  If this works,
then the parse_first_line option is disabled on your system.  I don't
know MikTeX at all but maybe there is an option to switch it on by
default.  In teTeX parse_first_line is disabled by default.

  >  but then he says latex not found ! is this a
  > configuration problem or ... ?

Does latex work?  MikTeX is modular and maybe you do not have
installed everything you need.

  > and another problem. if i stick to a simple file, with only some
  > (plain)tex commands like this one here:

  > [...]

  > then i get fig1.1 file alright. if i open it with gsview however,
  > it produces some font-related errors like Error: /undefined in
  > cmsy10. same problems if i try to include the file in a latex
  > document.........

  > what am i doing wrong ?


You must now write a .tex file which loads fig1.1 and run this file
through tex and dvips.  dvips will then insert the fonts.

If you replace "beginfig(1);" by "beginfig(-1);" in fig1.mp then
metapost will will create an output file fig1.eps.

Look at the line:

  label.bot(btex $\sqrt{3}$ etex, 1/2[z0,z1]);

You need a square root symbol here.  The PostScript file produced by
metapost does not contain any fonts but only font names.

gsview doesn't know about the fonts supplied by MikTeX.  You need

You can produce eps files which can be used by gsview directly.
You then have to insert the line


into fig1.mp.  But then you can't use btex ... etex any more.

  > i have been looking for answers since a
  > couple of hours now, but didnt find anything resolving my
  > problems.............

IMHO the documentation of metapost is at least not as good as it could
be.  Taco Hoekwater is maintaining metapost now and he already got the
tex sources of the manual.  Thus, an improved version will be available
in the future.


Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.

More information about the texhax mailing list