From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96975 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Asymptote or Metapost and ConTeXt parameters. Date: Mon, 19 Dec 2016 10:10:09 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4975671057897616784==" X-Trace: blaine.gmane.org 1482138638 704 195.159.176.226 (19 Dec 2016 09:10:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Dec 2016 09:10:38 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 19 10:10:34 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cItxn-0007Sv-1C for gctc-ntg-context-518@m.gmane.org; Mon, 19 Dec 2016 10:10:31 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E7B2A12012AE; Mon, 19 Dec 2016 10:10:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9MjyYDzzlhlg; Mon, 19 Dec 2016 10:10:24 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 0FEA3120105D; Mon, 19 Dec 2016 10:10:24 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 26BD0120105D for ; Mon, 19 Dec 2016 10:10:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5jeoatzjPAbM for ; Mon, 19 Dec 2016 10:10:21 +0100 (CET) Original-Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id B60E91200D0D for ; Mon, 19 Dec 2016 10:10:11 +0100 (CET) Original-Received: by mail-it0-f43.google.com with SMTP id b132so46735274iti.1 for ; Mon, 19 Dec 2016 01:10:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=YFGZZ4U6F2YG/y4lrmnrImd0tAOx64uDxYBMrVhMA9U=; b=qCYP7RsubvI6jQ6CLDZYKftckipp49d2xOourH5gokwlNg346cxIBQWRqgxfV98HL6 WF0C975xOu5/gCEUC9huBfV+2oEQVxOjH12EkJZdVanVT5SHNLlIlv8tDJZ5/deMhJtR dK6fFZcAu1f4d9UNr8NEr2451kJvNqmcjRZtxjaPdyZpOps7WaEOALA7JYMCkmWhgdX1 r3+Nuk7u6XctlcvnssFDFnbn3cXYFkuVJARHKEVbXFlRZlqTGkRLE2DzbfwGKtHfszVW lpt3vikhGCb4EY9KnU+7wGIz4PYL0Ecop9M7gNmr7QaYxdDvmVpImdN6G1TGRPFeEQFm fvlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=YFGZZ4U6F2YG/y4lrmnrImd0tAOx64uDxYBMrVhMA9U=; b=Pzjv2nYh13gmq2wxerxmlKUNlTf64+ekquIC571BVAC/rsZhuaQeab/LXoqpdllLrj 6pZOjXcsdyWWFsgfjcT+ArF5+biaJGPuHrtYAV81vGd4XbTC7RlJWQ7ZTdL8I91yG3Dg G6Y64d2ZhLmpRGw50Ed2ajaMkqqqyXwdkJVFlFqEy3j6XuH3VRJ6yAGmGLE590xkE32D bYL5JeM2B63TFqL/wnZXqsf+YmNv2RZqDmMRIndOwpAa+LEK4lPuYwXdCZDHIaJoFwzn uA4+HkplNW21paWpmb2TIExr6/8cqDSk8CKYt/IU3v+tdvg7PvD9o6IFu+syUmmFIFNT UUaQ== X-Gm-Message-State: AKaTC02xPhBmzlqeeODjcillcVxPv5JdFUNMIgz44drGxPBtxgYz8eOepzRuort2gr6sq2/twMFM5uDSqTTm6w== X-Received: by 10.36.61.207 with SMTP id n198mr15753597itn.60.1482138609836; Mon, 19 Dec 2016 01:10:09 -0800 (PST) Original-Received: by 10.64.245.205 with HTTP; Mon, 19 Dec 2016 01:10:09 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:96975 Archived-At: --===============4975671057897616784== Content-Type: multipart/alternative; boundary=001a1144445658e8db0543ff492d --001a1144445658e8db0543ff492d Content-Type: text/plain; charset=UTF-8 Hello, I do not answer the question, but I'm interested because I also use Asymptote. The following code works with context in texlive 2016 but does not work with standalone context. thank you, Fabrice % macros=mkvi \usemodule[filter] \defineexternalfilter [ASY] [ filter={asy -tex "context" -outformat pdf -outname \externalfilteroutputfile}, output=\externalfilterbasefile.pdf, cache=yes, readcommand=\ReadImage, ] \define[1]\ReadImage{\externalfigure[#1]} \starttext Testing if we can include an asymptote image \startplacefigure[location={here}, title={An Asymptote figure}] \startASY import three; size(8cm,0); currentlight.background=black; material White(real x, real y){ return material(diffusepen=gray(.05+.1x+.3y), emissivepen=gray(.05+.1x+.3y)); } for(int y=0; y<=2; ++y) for(int x=0; x<3; ++x) draw(shift(2x,2y,0)*unitsphere,White(x,y)); \stopASY \stopplacefigure \stoptext 2016-12-19 8:41 GMT+01:00 Jaroslav Hajtmar : > Hello ConTeXtist, > > I saw the opportunity to insert an Asymptote picture into Context source > code (due filter). > > For example here: https://mailman.ntg.nl/pipermail/ntg-context/2015/ > 080581.html > > > > Is there a way to pass the ConTeXt parameter which influenced the creation > of the Asymptote image? My point eg. the ability to define macros, which > gave its parameters to Asymptote procedure or function and depending on > these parameters, the image created by Asymptote looked differently. > > > > Before starting work on an illustrative example I am asking, whether it > makes sense to deal with such a thing ... I suppose the impossibility of > combining asymptote code and such Lua code (or not?). > > > > There is a similar possibility, at least in Metapost? For simpler pictures > it would probably suffice .... > > > > Thanx > > Jaroslav Hajtmar > > > > ____________________________________________________________ > _______________________ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ____________________________________________________________ > _______________________ > --001a1144445658e8db0543ff492d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello,
I do not answer the question, but I'm interested because = I also use Asymptote. The following code works with context in= texlive 2016 but does not work with standalone context.
th= ank you,
Fabrice

% macros=3Dmkvi

\u= semodule[filter]

\defineexternalfilter
=C2=A0=C2=A0 [ASY]
=C2= =A0=C2=A0 [
=C2=A0=C2=A0=C2=A0=C2=A0 filter=3D{asy -tex "context&qu= ot; -outformat pdf
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 -outname \externalfilteroutputfile},
=C2=A0=C2=A0= =C2=A0=C2=A0 output=3D\externalfilterbasefile.pdf,
=C2=A0=C2=A0=C2=A0=C2= =A0 cache=3Dyes,
=C2=A0=C2=A0=C2=A0=C2=A0 readcommand=3D\ReadImage,
= =C2=A0=C2=A0 ]

\define[1]\ReadImage{\externalfigure[#1]}

\sta= rttext
=C2=A0=C2=A0 Testing if we can include an asymptote image
=C2= =A0=C2=A0 \startplacefigure[location=3D{here}, title=3D{An Asymptote figure= }]
=C2=A0=C2=A0=C2=A0=C2=A0 \startASY
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 import three;
size(8cm,0);
currentlight.background=3Dblack;
material White(real x, real y){
=C2=A0=C2=A0 return material(diffus= epen=3Dgray(.05+.1x+.3y),
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 emissivepen= =3Dgray(.05+.1x+.3y));
}

for(int y=3D0; y<=3D2; ++y)
=C2=A0= =C2=A0=C2=A0 for(int x=3D0; x<3; ++x)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 draw(shift(2x,2y,0)*unitsphere,White(x,y));
=C2=A0=C2=A0=C2= =A0=C2=A0 \stopASY
=C2=A0=C2=A0 \stopplacefigure
\stoptext
=C2=A0=

2= 016-12-19 8:41 GMT+01:00 Jaroslav Hajtmar <hajtmar@gyza.cz>:

Hello ConTeXtist,

I saw the opportuni= ty to insert an Asymptote picture into Context source code (due filter).=

For example here: <= a href=3D"https://mailman.ntg.nl/pipermail/ntg-context/2015/080581.html" ta= rget=3D"_blank">https://mailman.ntg.nl/pipermail/ntg-context/2015/080581.html

=C2=A0

Is there a way to p= ass the ConTeXt parameter which influenced the creation of the Asymptote im= age? My point eg. the ability to define macros, which gave its parameters t= o Asymptote procedure or function and depending on these parameters, the image created by Asymptote looked diffe= rently.

=C2=A0

Before starting wor= k on an illustrative example I am asking, whether it makes sense to deal wi= th such a thing ... I suppose the impossibility of combining asymptote code= and such Lua code (or not?).

=C2=A0

There is a similar = possibility, at least in Metapost? For simpler pictures it would probably s= uffice ....

=C2=A0

Thanx

=

Jaroslav Hajtmar=

=C2=A0


_____________________________________________________________= ______________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" rel=3D"noreferrer= " target=3D"_blank">http://www.ntg.nl/mailman/listinfo/ntg-context=
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/cont= ext-mirror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
_________________________________________________________________= __________________

--001a1144445658e8db0543ff492d-- --===============4975671057897616784== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============4975671057897616784==--