Florian, This is not exactly how to proceed. The metapost export needs to be stripped of its preamble before being used with ConTeXt. Can you send us a (simple) concrete example, i.e. .fig file. It may not be worth the effort to get fig2dev fixed to produce pure (LaTeX free) metapost. I had started learning Metapost playing with xfig exports, but quickly entirely dropped xfig and now work directly with metapost code. Alan On Friday 07 January 2011 16:39:45 Florian Unglaub wrote:
On Fri, Jan 07, 2011 at 10:09:47AM +0100, Taco Hoekwater wrote:
I did a quick test, and the transfig mp code starts with this nice (!) block of verbatimtex:
% +MP-ADDITIONAL-HEADER verbatimtex %&latex \documentclass{article} \begin{document} etex % -MP-ADDITIONAL-HEADER
[...]
It looks configurable-ish, but I do not feel like experimenting without a proper test case.
I tried exporting to metapost inside xfig aswell yesterday, leading to similar results as posted above.
I found out that XFig uses a small shell script called 'fig2dev' to do all the exporting to other formats. This script supports an option '-o' to use plain TeX.
I tried \input'ing the resulting .mp file into my ConTeXt-file:
\startuseMPgraphic{foo} \input ../figures/bar.fig \stopuseMPgraphic
\placefigure[here][fig:foo]{A small test}{ \useMPgraphic{foo} }
This, however, doesn't work and shows the figure as 'undefined' in the PDF.
My current solution now is to convert the XFig file to MetaPost with fig2dev and use mptopdf.
Regards, Florian.
PS: Sorry for the duplicate message, Taco. I forgot to CC to the list.
-- Alan Braslau CEA DSM-IRAMIS-SPEC CNRS URA 2464 Orme des Merisiers 91191 Gif-sur-Yvette cedex FRANCE tel: +33 1 69 08 73 15 fax: +33 1 69 08 87 86 mailto:alan.braslau@cea.fr .''`. : :' : `. `'` `-