Re: [NTG-context] importing figures in metapost
Thanks Mojca, (I put again the discussion on the list)
andrea valle wrote:
Thanks a lot, It seems that it is exactly what I need,as I want to use pdfs. Actually I'm able to scale, but not to shift.
I don't understand why not. Can you send an (non-working) example?
It seems to me that this: % 1 \setupcolors[state=start] \starttext \startuseMPgraphic{dummy} externalfigure "mptext.pdf" xyscaled (10cm, 8cm) shifted (3cm, 6cm); \stopuseMPgraphic \useMPgraphic{dummy} \stoptext and % 2 \setupcolors[state=start] \starttext \startuseMPgraphic{dummy} externalfigure "mptext.pdf" xyscaled (10cm, 8cm) shifted (3cm, 6cm); \stopuseMPgraphic \useMPgraphic{dummy} \stoptext ...have the same results. (these are my pdfs in output: http://www.semiotiche.it/andrea/conTest.pdf http://www.semiotiche.it/andrea/conTest1.pdf ) Where am I making a mistake?
It is not extensively documented, it is only mentioned in metafun manual (CTRL-F to search in Acrobat). Or, alternatively, you can take a look at:
So, how do I know all the options I can use? Simply I can't? Best -a-
andrea valle wrote:
Thanks Mojca, (I put again the discussion on the list)
andrea valle wrote: It seems to me that this:
Btw: take a look at the thread "MetaFun questions" in ConTeXt archive and at the command naturalfigure(expr name) defined in mp-figs.mp.
externalfigure "mptext.pdf" xyscaled (10cm, 8cm);
and
externalfigure "mptext.pdf" xyscaled (10cm, 8cm) shifted (3cm, 6cm);
...have the same results.
Of course they do. Metapost is clever enough to calculate the proper bounding box. If you "draw origin" or "draw origin shifted anypointyoucanthinkof" and if that is the only thing you draw, than both figures will be identical. If you would like the figure to be different, you can set the bounding box explicitely with: setbounds currentpicture to unitsquare xyscaled ... shifted ...; If you want your graphic to appear somewhere else on the page than you have to handle that with plain TeX/ConTeXt commands to achieve the desired placing ... or using layers in MetaFun.
So, how do I know all the options I can use? Simply I can't?
The command externalfigure in MetaFun has no additional options/parameters. The best place to learn metafont/post/fun is: - take The METAPOSTBook in a library (not necessary) - metapost manual: http://www.tug.org/tutorials/mp/mpman.pdf - MetaFun manual: http://www.pragma-ade.com/general/manuals/metafun-s.pdf - sources: go to http://source.contextgarden.net/ and search for externalfigure for example I usually use the metapost and metafun manual and simply the search function in Adobe Acrobat fo find what I'm looking for. Reading the whole metafun manual is no bad idea anyway. If you're looking for ConTeXt documentation: well, yes, than you start reading one manual after another, keep looking into the source code and search through the mailing list archive & contribute to Wiki. I'm affraid there's no other way for the moment. Mojca
(...) ahem, yes. Sorry, I forgot a % before a
shifted (3cm, 6cm);
in the second example I suppose Mojca has already replied considering the %. Thanks -a- On 13 Jun 2005, at 19:20, Taco Hoekwater wrote:
andrea valle wrote:
It seems to me that this: % 1 ... and % 2 ... ...have the same results.
That's what I would expect as well, from identical input ;)
Taco _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Andrea Valle Laboratorio multimediale "G. Quazza" Facoltà di Scienze della Formazione Università degli Studi di Torino andrea.valle@unito.it
participants (3)
-
andrea valle
-
Mojca Miklavec
-
Taco Hoekwater