From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/5445 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Date: Wed, 29 Aug 2001 18:04:46 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20010829170916.023c8af0@server-1> References: <002a01c1309d$1ee976a0$0100a8c0@mshome.net> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035396038 1693 80.91.224.250 (23 Oct 2002 18:00:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:00:38 +0000 (UTC) Cc: "Group ppchtex" , ntg-context@ntg.nl Original-To: =?iso-8859-1?Q?Herv=E9?= Rouault In-Reply-To: <002a01c1309d$1ee976a0$0100a8c0@mshome.net> Xref: main.gmane.org gmane.comp.tex.context:5445 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:5445 At 05:13 PM 8/29/2001 +0200, Hervé Rouault wrote: >Hi all!! > >How can I load a ppchtex graphic to add something with metapost. I don't >know which command to use... I tried with loadcurrentgraphc, then it's >loaded but i can't modify it. > >I have already ask the question th Hans, but I'd like more explaination. Ah, so the manual sucks -) Well, i hope that the next example shows you the way to even more dirty trickery. The \cpos macro will be added to ppchtex.tex [beware: this example only works in context] [i'll send you the file off line] % output=pdftex \usemodule[chemic] \def\cpos#1#2% {\bgroup \pushmacro\dowithchemical \gdef\dowithchemical##1{\hpos{#1}{##1}\popmacro\dowithchemical}% #2% \egroup} \starttext The idea is this: \startMPpositiongraphic{connect} initialize_box_pos(1, \MPpos{\MPvar{from}}) ; initialize_box_pos(2, \MPpos{\MPvar{to}}) ; pickup pencircle scaled 1.5pt ; draw pxy[1] ; draw pxy[2] ; drawarrow (cxy[1] -- cxy[2]) dashed evenly ; anchor_box(\MPanchor{\MPvar{from}}) ; \stopMPpositiongraphic \setMPpositiongraphic{chem:a}{connect}{from=chem:a,to=chem:b} \hpos{chem:a}{A} \hskip3cm \hpos{chem:b}{B} Applied to a chemical: \startMPpositiongraphic{connect} initialize_box_pos(1, \MPpos{\MPvar{from}}) ; initialize_box_pos(2, \MPpos{\MPvar{to}}) ; pickup pencircle scaled 1.5pt ; drawarrow (cxy[1] {up} .. cxy[2]) dashed evenly ; anchor_box(\MPanchor{\MPvar{from}}) ; \stopMPpositiongraphic \setMPpositiongraphic{chem:1}{connect}{from=chem:1,to=chem:2} \startchemical \chemical[SIX,B,R,RZ][A,\cpos{chem:1}{B},C,D,\cpos{chem:2}{E},F] \stopchemical Or crossing chemicals: \startMPpositiongraphic{explain} initialize_box_pos(1, \MPpos{\MPvar{from}}) ; initialize_box_pos(2, \MPpos{\MPvar{by}}) ; initialize_box_pos(3, \MPpos{\MPvar{to}}) ; pickup pencircle scaled 1.5pt ; draw fullcircle scaled 1cm shifted cxy[2] ; drawarrow (cxy[1] .. cxy[2] .. cxy[3]) dashed evenly ; anchor_box(\MPanchor{\MPvar{from}}) ; \stopMPpositiongraphic \setMPpositiongraphic{chem:3}{explain}{from=chem:3,by=chem:4,to=chem:5} \startchemical \chemical[SIX,B,R,RZ][A,\cpos{chem:3}{B},C,D,\cpos{chem:4}{E},F] \stopchemical \startchemical \chemical[SIX,B,R,RZ][A,\cpos{chem:5}{B},C,D,E,F] \stopchemical \stoptext ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------