On Mon, 24 Nov 2008, Jan-Erik Hägglöf wrote:
Hi All!
I'm in beginning to write a thesis in physics(undergraduate level) and one of many things I wanna do is, cause I create much illustrations in DIA http://www.gnome.org/projects/dia/ and the program can export to figure.mp, to include these in my document.
I've read the instructions on http://wiki.contextgarden.net/Mpgraphic
I do not get this working. How is the best way to accomplish this?
See the attached file. Dia exports the figure with verbatimtex &latex etex which tells metapost to run labels through latex. I guess that this is what causes the errors. If you simply remove some of the boiler plate, the figure compiles fine (see attached file)
The reason is why I want to do in this way is to input tex code in the figure (especially math and symbol definitions) and optionally place them in specific places inside the figure. By this method I can even do better illustrations, hopefully.
My workflow has been like this:
1. Create the desired figure in DIA and choose the export option. TeX metapost *.mp(see attached file ).
2. Tryed to do inclusion in a TeX-document like this
\startstaticMPfigure{magflux} the code in the attached file \stopstaticMPfigure
\starttext
Here is my figure \usestaticMPfigure[magflux][width=0.8\textwidth]
\stoptext
But it fails with errormessage:
!Paragraph ended before \startstaticMPfigure was complete .....
Should I place part of the code in some definitions?
I do not get this error, but staticMPfigure is not working for me. I would recomment not to use staticMPfigure, rather use useMPfigure. (I had asked Hans for staticMPfigure a few years ago when TeX-MP interaction was slow. Now, with MPLib I do not think that we need the staticMPfigure mechanism. Personally, I haven't used it for a while) I also had to add save x, y, t, p ; %%%% Added this line to include the figure multiple times (or to include multiple figures, I would imagine). Aditya