RE: Using MetaPost output in pdflatex...



I haven't been dia'ing or latex'ing for quite some time (sad world where I
don't write papers anymore), but I don't ever remember directly including
the metapost file into my latex file.  Maybe I didn't know better.  At any
rate, from a Dia list mail I sent shortly after writing the initial MetaPost
plugin:

"Basically you just put your LaTeX expression in a text box, export your
diagram to produce a .mp file, run mpost file.mp to produce file.1 which can
be renamed to file.eps and used.  The eps file will have your latex results
in it."

This worked, at least, at one time.

-----Original Message-----
From: dia-list-bounces gnome org [mailto:dia-list-bounces gnome org] On
Behalf Of Rob McDonald
Sent: Friday, January 20, 2006 10:02 AM
To: dia-list gnome org
Subject: Using MetaPost output in pdflatex...

I would like to use Dia diagrams in pdflatex.

At first, I was having trouble with the seamless integration of the *.mp
files into my document.  I posted on comp.text.tex, and was able to come to
the following resolution.

\begin{figure}
\begin{emp}
\input diagram.mp;
\end{emp}
\end{figure}

emp is the encapsulated metapost package, and it does a nice job of handling
the metapost .1 files etc.

Unfortunately, MetaPost croaks on all but the most trivial of files exported
from Dia.

If I create a diagram with a single simple rectangle, everything works
great.

If I throw in a UML class and a line connecting it to the rectangle,
metapost starts complaining about the LaTeX-ish tags in the *.mp file.

! Misplaced alignment tab character &.
1.1 &
     latex
?

And

! Undefined control sequence.
1.2 \documentclass
                  {minimal}
?

If I throw a "% " in front of them, it gets past those complaints, but then
complains like this...

! Undefined control sequence.
1.16 {\usefont
              {OT1}{phv}{b}{n} Class}\stopmpxshipout ?

Is anyone using dia and pdflatex to create and use nontrivial metapost
files?  What is the best way to do this?

I'm running Win2K with MiKTeX.  Everything is up to date.

I was running Dia 0.94 on Windows, but that crashed a lot, and had lots of
issues.  (I can provide reports if they're needed, but these problems aren't
exactly hiding.).  So, I spent a day and a half installing coLinux (I've
been meaning to do that), and am now running Dia 0.94 in Linux, without all
the problems I was having on Windows.

The above problems happen whether the file was exported from Dia Windows or
Dia Linux.

Thanks in advance,

               Rob

_______________________________________________
Dia-list mailing list
Dia-list gnome org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://www.gnome.org/projects/dia/faq.html
Main page at http://www.gnome.org/projects/dia





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]