From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/50592 Path: news.gmane.org!not-for-mail From: Alan Stone Newsgroups: gmane.comp.tex.context Subject: Re: MP newbie question Date: Tue, 19 May 2009 08:02:49 +0200 Message-ID: <326847810905182302v15687c92q33c507abf968909a@mail.gmail.com> References: <326847810905181145p77ce2388q1d4500bbb55c09f7@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2102977827==" X-Trace: ger.gmane.org 1242713030 25756 80.91.229.12 (19 May 2009 06:03:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 May 2009 06:03:50 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 19 08:03:43 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1M6IQP-0004E9-A2 for gctc-ntg-context-518@m.gmane.org; Tue, 19 May 2009 08:03:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0E6981FCCE; Tue, 19 May 2009 08:03:40 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 24591-02-6; Tue, 19 May 2009 08:03:09 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 318F41FB5B; Tue, 19 May 2009 08:03:09 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D90891FCB1 for ; Tue, 19 May 2009 08:03:06 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 24594-03-4 for ; Tue, 19 May 2009 08:02:50 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by ronja.ntg.nl (Postfix) with ESMTP id BBDCA1FB5B for ; Tue, 19 May 2009 08:02:50 +0200 (CEST) Original-Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.147]) by filter1-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n4J62nfQ002334 for ; Tue, 19 May 2009 08:02:50 +0200 Original-Received: by ey-out-1920.google.com with SMTP id 4so946310eyg.38 for ; Mon, 18 May 2009 23:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gJ5htGXyndSARu6NIrKpwCGjzmHRtqaRTplGww8DJaM=; b=hcseEfrZhyss3z+IXQcQOr2vWnO+T8h3jd+vueYpmfh8CIAP05kdz4ve/pxe7WaEbF DOvYqJ20imqo7YZ4ZZ7WuSr4SXnW4eC1mMsi9uYX7ucKCIx7ChstTXEhGYSuAsPdei+4 8paRXmwQR9+uTDC1/TFmgusIGtpTV/8jmuvT8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=C7zA0g3v7lOBR4DzAzZcHrqwxHuxgys5iGzcH8aXSkCdmzbE9Jjz5O9uFr0GaTMNd8 SggeKe/U99CEv2kuWxhoAdZFjhnC1EWnlnN8BAlzt4RCQBmLHU6KlxUnxHFI7BZbBJj+ HMJiPVbzKOH8rleMZ12vw2mCfx0fW9wGWRjyA= Original-Received: by 10.216.53.196 with SMTP id g46mr2414325wec.63.1242712969452; Mon, 18 May 2009 23:02:49 -0700 (PDT) In-Reply-To: <326847810905181145p77ce2388q1d4500bbb55c09f7@mail.gmail.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.78.147; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 227939448 - 5d9fee530edd - 20090519 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:50592 Archived-At: --===============2102977827== Content-Type: multipart/alternative; boundary=0016e6dee7ea1a1ba0046a3da997 --0016e6dee7ea1a1ba0046a3da997 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Mon, May 18, 2009 at 8:45 PM, Alan Stone wrote: > Hi, > How do you make this work ? > > --- mpframed.tex --- > > %\def\myFrameAlternative{line} > %\def\myFrameAlternative{dashes} > \def\myFrameAlternative{dots} > The MetaPost User Manual brought the answer... %\def\myFrameAlternative{"line"} %\def\myFrameAlternative{"dashes"} \def\myFrameAlternative{"dots"} > \startuniqueMPgraphic{name} > > path p ; > > p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; > show (\myFrameAlternative) ; > > if \myFrameAlternative = dashes : > if \myFrameAlternative = "dashes" : Alan > % if (\myFrameAlternative) = dashes : > draw p dashed evenly scaled 2 ; > % elseif (\myFrameAlternative) = dots : > elseif \myFrameAlternative = dots : > draw p dashed withdots scaled 2 ; > else : > draw p ; > fi ; > \stopuniqueMPgraphic > > \defineoverlay[myGraphic][\uniqueMPgraphic{name}] > > \starttext > > \framed[% > offset=5mm, > background=myGraphic, > frame=off] > {mp framed} > > \stoptext > > --- > > context.cmd mpframed > > -- > Alan > --0016e6dee7ea1a1ba0046a3da997 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, May 18, 2009 at 8:45 PM, Alan Stone <software= .list.1es9s@gmail.com> wrote:
Hi,=20

How do you make this work ?

--- mpframed.tex ---

%\def\myFrameAlternative{line}
%\def\myFrameAlternative{dashes}
\def\myFrameAlternative{dots}
=A0
The MetaPost User Manual brought the answer...
=A0
%\def\myFrameAlternative{"line"}
%\def\myFrameAlternative{"dashes"}
\def\myFrameAlternative{"dots"}
=A0
\startuniqueMPgraphic{name}

path p ;

p :=3D unitsquare xscaled \ove= rlaywidth yscaled \overlayheight ;
show (\myFrameAlternative) ;

if \myFrameAlternative =3D das= hes :
=A0
if \myFrameAlternative =3D "dashes" :
=A0
Alan
=A0
% if (\myFrameAlternative) =3D= dashes :
draw p dashed evenly scaled 2 = ;
% elseif (\myFrameAlternative)= =3D dots :
elseif \myFrameAlternative =3D= dots :
draw p dashed withdots scaled = 2 ;
else :
draw p ;
fi ;
\stopuniqueMPgraphic

\defineoverlay[myGraphic][\uniqueMPgraphic{name}]

\starttext

\framed[%
offset=3D5mm,
background=3DmyGraphic,
frame=3Doff]
{mp framed}

\stoptext

---

context.cmd mpframed

--
Alan
--0016e6dee7ea1a1ba0046a3da997-- --===============2102977827== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============2102977827==--