From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/72251 Path: news.gmane.org!not-for-mail From: Syed N Haider Newsgroups: gmane.comp.tex.context Subject: Background using Image Overlay Date: Mon, 7 Nov 2011 22:45:01 -0500 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2017926493==" X-Trace: dough.gmane.org 1320723925 2085 80.91.229.12 (8 Nov 2011 03:45:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Nov 2011 03:45:25 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 08 04:45:21 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RNccj-0004l5-FB for gctc-ntg-context-518@m.gmane.org; Tue, 08 Nov 2011 04:45:21 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D7610CB0C5; Tue, 8 Nov 2011 04:45:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KBiyzCZjGrHa; Tue, 8 Nov 2011 04:45:17 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CF35DCB0C0; Tue, 8 Nov 2011 04:45:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 43438CB0C0 for ; Tue, 8 Nov 2011 04:45:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xkt+rnZltnKl for ; Tue, 8 Nov 2011 04:45:04 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 771ADCA680 for ; Tue, 8 Nov 2011 04:45:04 +0100 (CET) Original-Received: from mail-qw0-f41.google.com (mail-qw0-f41.google.com [209.85.216.41]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pA83j1de007914 for ; Tue, 8 Nov 2011 04:45:02 +0100 Original-Received: by qadc11 with SMTP id c11so5410514qad.14 for ; Mon, 07 Nov 2011 19:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=1vN73QAgIpB+6PyK0rAoHlXYDwyzc+0sRUN3XMO9SWs=; b=R7hxd96FCGZXv/XKJEgYFnGNz4kUWq5s1f+Dzop39eHY2nPG6jofibvS98LfhCbD13 7m6Y0CgasqTProoTnoZSFEKrsON7F3mcPZ/HPp1ptPWEqd5EYCldxSol4F/WWd1osSzU PuRu+PL1W0bxKQUOXdKHkgfhaFFX6N9D4Q4vI= Original-Received: by 10.229.34.19 with SMTP id j19mr3362089qcd.182.1320723901410; Mon, 07 Nov 2011 19:45:01 -0800 (PST) Original-Received: by 10.229.192.146 with HTTP; Mon, 7 Nov 2011 19:45:01 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.216.41; 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: 03FSrJ2oo - 241978547c87 - 20111108 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:72251 Archived-At: --===============2017926493== Content-Type: multipart/alternative; boundary=00163649a683fd6e1004b130fe96 --00163649a683fd6e1004b130fe96 Content-Type: text/plain; charset=ISO-8859-1 Hi All I am new to the Metapost and Context world, and need some help regarding the inclusion of Metapost graphics in ConTeXt documents. I am trying a very simple approach, using a graphic as a background. Here's my sample (using a very basic metapost graphic as a page background in a document): Metapost: ======== beginfig(0); theta := 360/7; radius := 1in; z0 = origin; z1 = z0 + dir(90)*radius; z2 = z0 + dir(90 + theta)*radius; z3 = z0 + dir(90 + 2*theta)*radius; z4 = z0 + dir(90 + 3*theta)*radius; z5 = z0 + dir(90 + 4*theta)*radius; z6 = z0 + dir(90 + 5*theta)*radius; z7 = z0 + dir(90 + 6*theta)*radius; draw z1 -- z2 -- z3 -- z4 -- z5 -- z6 -- z7 -- cycle; endfig; end; ConTeXt (after running mpost on the metapost graphic to generate the hexagon.0 file): ===================================================================== \defineoverlay [backg] [{\externalfigure[hexagon.0][width=\overlaywidth,height=\overlayheight]}] \starttext \noheaderandfooterlines \setupbackgrounds[page][background=backg] %\placefigure %{none} %{\externalfigure[hexagon.0][width=12cm]} \stoptext Thanks in advance Syed --00163649a683fd6e1004b130fe96 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi All
I am new to the Metapost and Context world, and need some help r= egarding the inclusion of Metapost graphics in ConTeXt documents. I am tryi= ng a very simple approach, using a graphic as a background. Here's my s= ample (using a very basic metapost graphic as a page background in a docume= nt):

Metapost:
=3D=3D=3D=3D=3D=3D=3D=3D
=
beginfig(0);
theta :=3D 360/7;
radius :=3D 1in;
z0 =3D origin;
z1 =3D z0 + dir(90)*radius;
z2 = =3D z0 + dir(90 + theta)*radius;
z3 =3D z0 + dir(90 + 2*theta)*radius;
z4 =3D z0 + dir(90 + 3= *theta)*radius;
z5 =3D z0 + dir(90 + 4*theta)*radius;
z= 6 =3D z0 + dir(90 + 5*theta)*radius;
z7 =3D z0 + dir(90 + 6*theta= )*radius;
draw z1 -- z2 -- z3 -- z4 -- z5 -- z6 -- z7
-- cycle;
<= div>endfig;
end;


ConTeXt (after running mpost on the metapost graphic to genera= te =A0the hexagon.0 file):
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
<= br>
\defineoverlay
[backg]
[{\externalfi= gure[hexagon.0][width=3D\overlaywidth,height=3D\overlayheight]}]

\starttext
\noheaderandfooterlines
= \setupbackgrounds[page][background=3Dbackg]
%\placefigure
%{none}
%{\externalfigure[hexagon.0][width=3D12cm]}
\stoptext




=
Thanks in advance

Syed


--00163649a683fd6e1004b130fe96-- --===============2017926493== 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============2017926493==--