Hi Jan-Erik, Jan-Erik Hägglöf schrieb: > 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? > > 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 ). > 1.1 remove all latex related code from the mp file
verbatimtex %&latex \documentclass{minimal} \begin{document} etex > 2. Tryed to do inclusion in a TeX-document like this > > \startstaticMPfigure{magflux} > the code in the attached file \input magfluxdensity.mp > \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? > > 3. To input textlabels in mathnotation optionally anywhere I want inside > the figure. > \startMPenvironment[global] ... global font defintions (esp. a math font), so metapost can also use them \stopMPenvironment Hope that helps... Best wishes, Peter > And also do something like > > \placefigure[][fig:metapostfigure]{Here is the figure I made in DIA > converted to metapost}{\usestaticMPfigure[magflux][width=0.8\textwidth]} > > so it also can be referred to in the text. > > All best and thanks in advance! > > Janneman > > > > > > ------------------------------------------------------------------------ > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________