From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/1900 Path: main.gmane.org!not-for-mail From: pragma@wxs.nl Newsgroups: gmane.comp.tex.context Subject: Re: Metapost and graphics Date: Mon, 24 Apr 2000 07:22:41 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <773639A58C1.AAA4746@po03.wxs.nl> NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035392701 4109 80.91.224.250 (23 Oct 2002 17:05:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:05:01 +0000 (UTC) Original-To: ntg-context@ntg.nl Xref: main.gmane.org gmane.comp.tex.context:1900 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:1900 >Hello, > >I'm new to ConTeXt and interested in including graphs in my documents. Since >PSTricks doesn't appear to be supported I've turned to METAPOST. I have some >questions about the code below. You can say: \usemodule[m-pstric] but indeed that does not work with pdf. >1. I've tried some of the examples from the MP docs and occasionally, the >"test" graphic fails when the beginfig(1)/endfig pair is included. That is because your beginfig overloads the automatic ones. So, no beginfig etc is needed. >2. Which is the preferred way to call the "test" image, (1) or (2) (see >below)? > >3. What is the purpose of the pair \startMPgraphic...\stopMPgraphic? It >doesn't seem to do anything. I bet it does. Add \runMPgraphicstrue (can also go in cont-sys.tex) and enable write18 in texmf.cnf and you will see that context generates the graphics runtime (otherwise they are generated between runs) >In the docs that I've found, there doesn't seem to be much on METAPOST info. >For example, the "graph" package isn't supported. Is there a more extensive >discussion of ConTeXt support of METAPOST somewhere? As far as I know the graph package should work. You can always make external figures and include them with \externalfigure. >\startuseMPgraphic{test} #### this wone is not needed >beginfig(1); > u=1cm; > draw (2u,2u)--(0,0)--(0,3u)--(3u,0)--(0,0); > pickup pencircle scaled 4pt; > for i=0 upto 2: > for j=0 upto 2: > draw (i*u,j*u); > endfor > endfor #### nor is this one >endfig; >\stopuseMPgraphic >%1 >\useMPgraphic{test} ok, should work now >%2 >\externalfigure[mpgraph.1] no, but when you make a graphic outside context you can say: \externalfigure[somefile.123] >%3 >\startMPgraphic > %same mp code as above. >\stopMPgraphic You need to provide a name like {test} Remark: when color is disables, contextwill automatically convert color in MP files into weighted grayscales. \ Hans